ova2 / primefaces-cookbook Goto Github PK
View Code? Open in Web Editor NEWPrimeFaces Cookbook - recipes to leading JSF component suite
Home Page: http://ova2.github.com/primefaces-cookbook/
PrimeFaces Cookbook - recipes to leading JSF component suite
Home Page: http://ova2.github.com/primefaces-cookbook/
Hi Oleg:
I've tried running the sample code on Jetty as advised in the readme file. Seems that some of the dependencies (Primefaces and Apache Commons File) need to be included in the Jetty plugin dependency list in order to get Jetty to startup.
After adding those, my Jetty server will start up, however, accessing the demo code via: http://localhost:8080/primefaces-cookbook/ produces 404 errors in my browser.
Can you please verify the Jetty deployment works?
Odd thing is that I can deploy and run to Tomcat, but when I do, I need to access the code via: http://localhost:8080/showcase
Chris
Edit: it appears the context is empty after Jetty startup:
[INFO] Webapp directory = C:\springsource\git\primefaces-cookbook\src\main\webapp
Mar 27, 2013 8:49:06 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.13 ( 20120907-1514) for context ''
Mar 27, 2013 8:49:07 AM com.sun.faces.spi.InjectionProviderFactory createInstance
Hi
I use tomcat 9 on top of jdk1.8, after download the package, I un-comment the mojarra profile section and run "mvn install -P mojarra"
war file is successfully build. However when running, it give me the error shown below.
[Error]
29-Aug-2016 01:13:53.279 SEVERE [http-nio-8080-exec-6] com.sun.faces.application.view.FaceletViewHandlingStrategy.handleRenderException Error Rendering View[/views/chapter11/errors/throwable.xhtml]
javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-" library
at org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:145)
at org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:77)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864)
Firstly it seem like the them 1.0.10 is not available in Maven repo, so I changed to 1.0.8
https://mvnrepository.com/artifact/org.primefaces.extensions/all-themes
But still same error. Any help?
So far the workaround is modify web.xml to hard code the theme name as shown below.
primefaces.THEME
cupertino
Rgds
SJ
Any plans to upgrade primefaces library to 3.5 or 4.0 ....?
Hi
The exception below is thrown on startup on jetty\tomcat and mvn:jetty.
The versions are:
jetty-distribution-9.2.3.v20140905
apache-tomcat-7.0.56
apache-maven-3.2.3
[WARNING] Could not instantiate listener ${jsf.startupListener}
java.lang.ClassNotFoundException: ${jsf.startupListener}
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:424)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:377)
at org.eclipse.jetty.server.handler.ContextHandler.loadClass(ContextHandler.java:1471)
at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitListener(StandardDescriptorProcessor.java:1839)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:80)
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:67)
at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:332)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1211)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:699)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
at org.eclipse.jetty.server.Server.doStart(Server.java:263)
at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:514)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
I am currently engaged in developing a web project using PrimeFaces. I bought your cookbook (pretty insightful !). I am putting in practice some concepts shown on this book, but I cannot execute a javacript from java. In short, I need "to click a button from java". I debugged and logged it, checked the browser's console for errors (none), tried jQuery's different notations ($, jQuery, PF), but nothing. I also reviewed the page's source code and jQuery plugin is there. Any hints is welcome !
Thanks in advance,
...
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<f:view contentType="text/html">
<div style="padding-right: 20px;">
<h:form prependId="false" id="userData">
<h:outputText id="indicator" value="Enabled? - #{LoginController.loggedIn}"/>
<p:commandButton id="btn2" widgetVar="btn2"
value="enable cash-in !" onclick="java.enableBillValidator()" />
...
if (password.equals(loggedCustomer.getPassword())) {
if (loggedCustomer.getPassword() == null) {
password = "";
password2 = "";
msg = "Error este usuario no tiene su clave seteada. Contacte al administrador.";
rc.execute("PF('dlgmsg').show();");
}
else {
loggedIn = true;
script1 = "PF('btn2').show();";
script2 = "$('btn2').show();";
script3 = "$('btn2').show();";
rc.execute(script1);
rc.execute(script2);
rc.execute(script3);
try {
ExternalContext ec = FacesContext.getCurrentInstance()
.getExternalContext();
ec.redirect(((HttpServletRequest) ec.getRequest())
.getRequestURI());
} catch (IOException e) {
log.error("Error inesperado.", e);
}
}
} else {
msg = "Contraseña incorrecta, reintente.";
rc.execute("PF('dlgmsg').show();");
}
}
helpss
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.