Illegal view ID error in navigation rule
parki Jan 3, 2008 2:12 PMHello:
First off, kudos to the developers - RichFaces is some pretty sweet stuff.
I'm running into one error (see below for full trace).
I'm setting up authorization stuff (based in part on the examples in Kito Mann's book). Everything works fine, with the following setup:
/web - ecobee.xhtml - login.xhtml - /WEB-INF - faces-config.xml - web.xml - /xhtml - foo.xhtml - bar.xhtml
web.xml:
<filter-mapping> <filter-name>AuthorizationFilter</filter-name> <url-pattern>/ecobee.jsf</url-pattern> </filter-mapping>
faces-config.xml:
<navigation-rule> <from-view-id>/login.xhtml</from-view-id> <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/ecobee.xhtml</to-view-id> <redirect /> </navigation-case> <navigation-case> <from-outcome>failure</from-outcome> <to-view-id>/login.xhtml</to-view-id> <redirect /> </navigation-case> </navigation-rule>
I'd like to move the 'ecobee.xhtml' file into the 'web/xhtml' directory, and change the authorization filter rule from the specific 'ecobee.jsf' file to filter on any file in the 'xhtml' directory. The changes:
web.xml:
<filter-mapping> <filter-name>AuthorizationFilter</filter-name> <url-pattern>/xhtml/*</url-pattern> </filter-mapping>
and faces-config.xml:
<navigation-rule> <from-view-id>/login.xhtml</from-view-id> <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/xhtml/ecobee.xhtml</to-view-id> <redirect /> </navigation-case> <navigation-case> <from-outcome>failure</from-outcome> <to-view-id>/login.xhtml</to-view-id> <redirect /> </navigation-case> </navigation-rule>
When I attempt this, I get an error (see below) which complains about an illegal view id - seems that the 'to-view-id' with value '/xhtml/ecobee.xhtml' doesn't work right.
I'm a little stumped - tried a few things, but I can't seem to be able to move the 'ecobee.xhtml' file from '/web' to 'web/xhtml' and have the authorization stuff still work.
Can anyone shed any light on this?
Many thanks - appreciated,
parki...
javax.servlet.ServletException: Illegal view ID .xhtml/ecobee.xhtml. The ID must begin with / javax.faces.webapp.FacesServlet.service(FacesServlet.java:256) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281) com.ecobee.webapp.servlet.AuthorizationFilter.doFilter(AuthorizationFilter.java:60) root cause java.lang.IllegalArgumentException: Illegal view ID .xhtml/ecobee.xhtml. The ID must begin with / com.sun.faces.application.ViewHandlerImpl.getActionURL(ViewHandlerImpl.java:627) com.sun.facelets.FaceletViewHandler.getActionURL(FaceletViewHandler.java:781) com.sun.facelets.FaceletViewHandler.handleFaceletNotFound(FaceletViewHandler.java:686) com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:637) org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108) org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281) com.ecobee.webapp.servlet.AuthorizationFilter.doFilter(AuthorizationFilter.java:60)