The API variable type converter has been deprecated since JSF 1.1. Use el-resolver instead

We recently upgraded from WebSphere Portal v6.1 to version 7.0, and now we have JSF 1.2. Creating a new Portlet project in Rad 8 creates a faces-config.xml file with the following entry

<application> <state-manager>com.ibm.faces.application.DevelopmentStateManager</state-manager> <variable-resolver>com.ibm.faces.portlet.PortletVariableResolver</variable-resolver> </application> 

And then complains: Type API variable-resolver is deprecated after JSF 1.1. Use el-resolver instead.

Unfortunately, I could not find the answer on the IBM pages for which el-resolver is used.

Edit:

 System.out.println("Resolver: " + PortalUtil.getFacesContext().getApplication().getELResolver()); 

=> Resolver: com.sun.faces.el.FacesCompositeELResolver@696e696e

Adding an entry to faces-config

 <el-resolver>com.sun.faces.el.FacesCompositeELResolver</el-resolver> 

With the removal of the resolver variable or without it leads to:

 java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:270) at javax.faces.webapp.FacesServlet.init(FacesServlet.java:164) at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358) ... 89 more 

PMR with IBM has opened ...

+6
source share
2 answers

IBM response to PMR:

Q - What could be the consequences of ignoring a warning?

Ans - The user can still use the resolver variable, the functionality will not be affected. [This tag will be supported for backward compatibility]

Q - Why are the generated faces-config.xml still using the deprecated method?

Ans. We use the resolver variable to enable portlet variables that will work even with JSF 1.2

Q - Will there be or not an el-resolver for portlets?

Ans. For portlets there will be an el-resolver. It will be introduced in the JSF portlet 2.0 portlet, which will be sent as an update to WAS. It is currently in the planning stages, so I cannot give you the exact version in which it will be found.

+1
source

I'm sorry to say this, but if we are talking about an asynchronous web application, then you are dead in the water.

JSF 1.2 introduced a β€œknown bug” (I always liked this phrase) - this is the FaceletsRenderer class, which prevents you from displaying JSF components asynchronously (since all asynchrony in JSF uses a fake FacesContext , not a functional one that can be used for rendering). You need JEE6-JSF 2.1 for this , otherwise you will need a different solution in general, as indicated in @D1e in his comment. Good luck with your organization.

0
source

Source: https://habr.com/ru/post/900237/


All Articles