We decided to upgrade to JSF 2.0, unfortunately this didn't work very well. We now have Mojarra, Tomahawk 2.0 1.1.11, Spring Webflow / Faces 2.3.0 and JSF 2.0.
I followed the upgrading tutorial from BalusC. The first step was to fix the the web.xml
and move to Servlet API 2.5.
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/facelets-taglibs/custom.taglib.xml</param-value>
</context-param>
<!-- Use JSF view templates saved as *.xhtml, for use with Facelets -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xml</param-value>
</context-param>
After this I replaced the dependencies and used the new versions of JSF.
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.3</version>
</dependency>
I adjusted our custom taglib and migrated to the new XML schema definition,
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd">
<namespace>http://www.custom.org/facelets-taglib</namespace>
[...]
I've also done all changes to the faces-config.xml
.
This is one of my *.jspx
files.
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" version="2.0"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:sf="http://www.springframework.org/tags/faces"
xmlns:os="http://www.custom.org/facelets-taglib">
[...]
${os:json()}
</html>
Before the migration this file worked great, it's a call to a specific function. Now it prints:
Caused by: javax.faces.FacesException: /WEB-INF/views/example.jspx(10,2)
The attribute prefix os does not correspond to any imported tag library
at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:136)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:115)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
at org.springframework.faces.webflow.FlowLifecycle.render(FlowLifecycle.java:80)
at org.springframework.faces.webflow.JsfView.render(JsfView.java:90)
at org.springframework.webflow.engine.ViewState.render(ViewState.java:296)
at org.springframework.webflow.engine.ViewState.refresh(ViewState.java:243)
at org.springframework.webflow.engine.ViewState.resume(ViewState.java:221)
at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:261)
... 67 more
Caused by: org.apache.jasper.JasperException: /WEB-INF/views/example.jspx(10,2)
The attribute prefix os does not correspond to any imported tag library
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
at org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1509)
at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:129)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:200)
at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:242)
at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:56)
Can you give me any hint where I did miss something or where a possible bug could hide? Thank you very much!