JSF components API url - jsf-2

Does anyone have the URL to the Mojara JSF 2 components API.
I seem to have lost it and cannot seem to find them via Oracle's site.

There's no such thing as "components API". Perhaps you meant the JSF 2 tag library documentation?
The JSF 2.x tag library documentations are available here:
JSF 2.0: http://docs.oracle.com/javaee/6/javaserverfaces/2.0/docs/pdldocs/facelets/
JSF 2.1: http://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/

Related

Log4j2 within web application with jsf 2

According with log4j and log4j2 documentation it's work well using tld with jsp pages.
http://logging.apache.org/log4j/2.x/manual/webapp.html
http://logging.apache.org/log4j/2.x/log4j-taglib/tagreference.html#log.tld
It is possible to be used with xmlns:log="http://logging.apache.org/log4j/tld/log" within jsp 2 xhtml page ?
My java faces web-app 3.0 catch the following error.
This page calls for XML namespace http://logging.apache.org/log4j/tld/log declared with prefix log but no taglibrary exists for that namespace.
My web environment is:
Java 1.6.0_38
Tomcat 7.0.50
Mojarra JSF 2.2.4
Primefaces RC 4.0
log4j2-beta9 (/web-INF/lib/ with log4j-1.2-api-2.0-beta9.jar,log4j-api-2.0-beta9.jar,log4j-core-2.0-beta9.jar,log4j-taglib-2.0-beta9.jar)
Any feedback it's appreciated.
Would you mind raising this on the Log4j2 issue tracker?
https://issues.apache.org/jira/browse/LOG4J2

Mixing JSF1.2 and JSF2

The legacy web app is using JSF1.2 with facelets. Due to the size of the app, upgrading it to JSF2 would take extensive effort. Is it possible to mix JSF1.2 and JSF2 in the same web app during the transition period?
I read this post: Mixing JSP and XHTML (Facelets) in JSF2 Project - possible?
but it seems to be related more to converting a JSP app to JSF2?
Thanks for any help.
Is it possible to mix JSF1.2 and JSF2 in the same web app during the transition period?
No.
You can mix JSP and Facelets in one web application, but you can definitely not mix different JSF impls/versions in the same web application. It would only result in class loading conflicts in all colors because multiple different versions of the very same classes are then present in the runtime classpath.
See also:
Migrating from JSF 1.2 to JSF 2.0

how to create Map in JSF

I want to use map in my JSF 2.0 website showing directions how to reach there (like this).
Any idea/ suggestion how to make map in jsf 2.0 would be greatful.
You can take a look at the gmaps4jsf library here, it has a component for directions here, but it is also noted that this component doesn't exists since version 3.0.0 so you will have to use older version.
You can start by studying the API documentation and its examples here:
https://developers.google.com/maps/documentation/javascript/

Cannot create a session after the response has been committed - PrettyFaces MultiPageMessagesSupport on Glassfish4

I have a Java EE app where I use JSF2 + PrettyFaces + EBJ3 + Glassfish
I just recently updated to Glassfish4 which is the default Server implementation for Java EE 7 and I started getting issues with PrettyFaces.
I have configured on my faces-config.xml:
<lifecycle>
<phase-listener>com.ocpsoft.pretty.faces.event.MultiPageMessagesSupport</phase-listener>
</lifecycle>
to enable for Faces Messages to be passed around correctly and displayed on screen.
But since I upgraded from Glassfish3 to 4 I started getting this issue:
java.lang.IllegalStateException: Cannot create a session after the response has
been committed
...
at com.ocpsoft.pretty.faces.util.FacesMessagesUtils.saveMessages(FacesMe
ssagesUtils.java:56)
at com.ocpsoft.pretty.faces.event.MultiPageMessagesSupport.afterPhase(Mu
ltiPageMessagesSupport.java:66)
If I remove the listener from faces-config.xml none of the Faces messages are displayed on screen.
I am using PrettyFaces to have nice well formatted URLs to enhance SEO on my site. I wish I couldn't have to replace it or refactor my app to not use it since I already mapped a lot of the navigation flow using it. Does somebody know a better option for this scenario?
I really appreciate any suggestions. Thanks.
I don't recommend to use MultiPageMessagesSupport if you are deploying to a "modern" container with JSF 2.2 support. The MultiPageMessagesSupport phase listener has been developed for JSF 1.x. JSF 2.x added support for persisting messages across redirects. Just execute this code before redirecting:
FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);

Is PrimceFaces 3.1 Backward Compatible to 2.x version

I'm developing a web app using JSF 2.0 + PrimeFaces 2.2.1
Now I think PrimeFaces 3.x is stable enough. (3.1)
Can I replace the library (PrimeFaces jar file) and continue the development. I know some features have been re-invented in PrimeFaces 3.1.
Will this change make any problem to my app?
You can find the main changes in PrimeFaces 2.2 --> 3.0 in the PrimeFaces wiki. Here's an extract of relevance:
General Changes
Taglib namespaces are changed as;
http://primefaces.prime.com.tr/ui -> http://primefaces.org/ui
http://primefaces.prime.com.tr/mobile -> http://primefaces.org/mobile
Note that this change applies 3.0.M4 and newer.
Component events are now decoupled and implemented as ajax behaviors to improve flexibility. Read more at here. Common *Listener and *Update attributes are now removed, an example is rating component;
2.x;
<p:rating value="#{ratingController.ratingValue}" rateListener="#{ratingController.handleRate}" update="messages"/>
3.x;
<p:rating value="#{ratingController.ratingValue}">
<p:ajax event="rate" listener="#{ratingController.handleRate}" update="messages" />
</p:rating>
User's guide and Taglib docs(IDE completion) will provide all the available events of a component.
RequestContext now allows to execute javascript from backing beans (e.g. deciding to keep a dialog open or hide it), In 2.x this conditional javascript execution on callbacks like oncomplete are achieved via callback params, execute("script here") makes it very easy to implement the same compared to callback params. Note that callback params are still supported and will be in future as they are also used internally in PrimeFaces.
Tag/Attribute docs are available again in facelet taglib to take advantage of quick documentation via IDE code completion.
Aristo replaced Sam as the built-in theme, sam is available at theme gallery as a downloadable theme.
You can find the main changes in PrimeFaces 3.0 --> 3.1 in this PrimeFaces blog. Here's an extract of relevance:
Backward Compatibility
There are two points to note regarding backward compatibility with 3.0;
Component referencing is now aligned with JSF Spec, if PrimeFaces cannot find a component, it will throw an exception. Since PrimeFaces 2.2 we’ve been logging an info message that component cannot be found and falling back to the client id. If you haven’t ignored these messages and fixed your code since 2.2, there won’t be a problem. If not, you need to update your component referencing with respect to findComponent specification.
primefaces.THEME_FORMS setting is removed in favor of plain css, if you need to reset the theme aware styles on input components, add a reset css instead.

Resources