We need to implement JSF 2.0 functionality in JSF 1.2
1)FacesContext.getAttributes()
2)UIViewRoot.getViewRoot()
Version of Jdeveloper we are using is 11.1.1.7.0.
The above two should be implemented in JSF 1.2.
Any ideas/suggestions are highly appreciated.
Thanks in advance.
Kind Regards,
Sarvani.
we cannot use JSF2, because we are using Jdeveloper 11.1.1.7 version so JSF 1.2.
We need to use the below functionality for the logging purpose.
FacesContext.getAttributes()
UIViewRoot.getViewMap()
As these are introduced in JSF2 , Any Idea/suggestions how to achieve the same functionality in JSF 1.2
-Jagadeesh Badri
Related
I am currently using Struts 2.0 version in my project. Now I want to move the Struts 2.5 version for the same. Can I directly move from 2.0 to 2.5?
If yes what things we need to change?
If no how can we achieve it? want detailed steps.
I'm planning to convert a web app from using JSF managed bean to using CDI managed beans. I know I'll need to do below:
Add a empty beans.xml file in WEB-INF.
Replace all JSF #ManagedBean to CDI #Named annotations.
Replace all JSF scope annotations with CDI or OmniFaces scope annotations.
Replace all JSF #ManagedProperty with CDI #Inject annotations.
Is that all that needs to be done? Are there any gotchas that I need to be aware of?
Basically, that's indeed all you need to do provided that you're on a Java EE server already. When on Tomcat, you'd need to manually install CDI first. Instructions for both Weld and OpenWebBeans are detailed in the blog How to install CDI in Tomcat?
The below gotchas need to be taken care of:
While OmniFaces 2.x "officially" requires JSF 2.2, OmniFaces 2.0/2.1 is technically backwards compatible with JSF 2.1 and should in TomEE's case work on TomEE 1.x with JSF 2.1 as well, but OmniFaces 2.2 has a hard JSF 2.2 dependency (due to the new <o:viewAction> tag) and won't deploy on TomEE 1.x without upgrading its MyFaces JSF implementation to a 2.2 compatible version, or itself being upgraded to TomEE 7.x. See also OmniFaces Compatibility Matrix.
When you deploy an EAR with multiple WARs with each its own OmniFaces library, then generally all CDI functionality will work in only one WAR as the CDI context of a WAR-provided library is incorrectly interpreted as EAR-wide. This is an oversight in CDI spec and yet to be fixed in a future CDI version. See also OmniFaces Known Issues (CDI).
When you want to use OmniFaces-provided CDI injection support in #FacesConverter or #FacesValidator, and you're going to create/use a CDI 1.1 compatible beans.xml (and thus not a CDI 1.0 compatible one or an empty one), then you need to make sure that you have explicitly set bean-discovery-mode="all" in beans.xml. See also #FacesConverter showcase.
When replacing #ManagedBean(eager=true), be aware that standard CDI has no direct equivalent for this. You would use #Observes for this. OmniFaces offers #Eager annotation for the purpose. See also How to configure a start up managed bean?
When replacing #ManagedProperty in JSF 2.0/2.1/2.2, be aware that you can't inject #{param.xxx}, #{cookie.xxx} and #{initParam.xxx} directly via #Inject alone, while that was just possible via #ManagedProperty. OmniFaces offers respectively #Param, #Cookie and #ContextParam for the purpose. Only in JSF 2.3 there's a new #javax.faces.annotation.ManagedProperty annotation which can be used exactly the same way as original #javax.faces.bean.ManagedProperty which got deprecated since JSF 2.3.
I have a need to use GORM, but to use certain libraries which require JPA 2 or 2.1. I see there is a plugin here (http://grails.org/plugin/gorm-jpa) for using GORM with JPA 1, but it's not been updated since 2012.
Is there a way to use GORM and JPA 2.x together? If not, what steps would one need to take to develop such capabilities?
Thanks in advance.
I have worked in jsf 1.2, rich faces and using hibernate ORM. I want to ask, how my project will change if i convert it to jsf 2.0 and prime faces. what can be the reason to shift to jsf 2.0? primitive question but i want to know from the experts the primary reason why would one shift from jsf 1.2 to jsf 2.0. Thanks.
First of all, in a JSF 2.0 you will get more functionallity then JSF 1.2
Like take a look at simple datatable tag in JSF 1.2 it is much more complex for like simple crud ops where in a JSF 2.0 all your code will be well optimised.
Plus like when you want to add some extra features and functionallity to your existing project, you will easily get support of external libraries.
Likewise when you are getting a error in JSF 1.2 it is more difficult to solve and get guide because very less resources available on it.
And on a last like it is very old version of JSF so I would suggest to move on JSF 2.0
I have an application, full application that made on JSF 1.2. Now we are adding module in it. Can i replace JSF 1.2 with JSF 2.0 ? Means only new module use JSF 2.0 and the remaining application become unaffected by the change? Means is JSF 2.0 is fully compatible with JSF 1.2. Like i open the project in netbeans and add JSF 2.0 jar in the project and remove the JSF 1.2 jar? Can i do that ? or i should have use JSF 1.2 for new module because application is made on JSF 1.2 ?
Thanks
There's a pretty good thread for that where they explain basic settings to more advanced settings to migrate from JSF 1.2 to JSF 2.0