[
http://jira.jboss.com/jira/browse/JBSEAM-1131?page=comments#action_12380605 ]
Dan Allen commented on JBSEAM-1131:
-----------------------------------
Additionally, the dispatcher tags are only relevant when using JSP. Seam-gen creates
projects that use Facelets, which use a different mechanism for "forwarding" to
view templates.
Example web.xml is incomplete
-----------------------------
Key: JBSEAM-1131
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1131
Project: JBoss Seam
Issue Type: Bug
Components: Tools
Reporter: Christian Bauer
I was running into this when using an ajax4jsf tag:
SEVERE: Error Rendering View[/docDisplay.xhtml]
javax.faces.FacesException: Resources framework is not initialised, check web.xml for
Filter configuration
at
org.ajax4jsf.framework.resource.ResourceBuilderImpl.getWebXml(ResourceBuilderImpl.java:107)
at
org.ajax4jsf.framework.resource.ResourceBuilderImpl.getUri(ResourceBuilderImpl.java:309)
at
org.ajax4jsf.framework.resource.InternetResourceBase.getUri(InternetResourceBase.java:211)
at
org.ajax4jsf.framework.resource.BaseResourceRenderer.encodeBegin(BaseResourceRenderer.java:62)
at
org.ajax4jsf.framework.resource.OneTimeRenderer.encodeBegin(OneTimeRenderer.java:48)
at
org.ajax4jsf.framework.resource.BaseResourceRenderer.encode(BaseResourceRenderer.java:45)
at
org.ajax4jsf.framework.resource.InternetResourceBase.encode(InternetResourceBase.java:306)
at org.ajax4jsf.framework.resource.ClientScript.encode(ClientScript.java:143)
at
org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.encodeResourcesArray(HeaderResourcesRendererBase.java:131)
at
org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.preEncodeBegin(HeaderResourcesRendererBase.java:117)
at
org.ajax4jsf.framework.renderer.RendererBase.encodeBegin(RendererBase.java:98)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:512)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
at
org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at
org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
It only happened right after redeployment, and if the first page I called (with an
ajax4jsf tag on it) was behind my rewrite filter, last in web.xml:
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>logLevel</param-name>
<param-value>WARN</param-value>
</init-param>
<init-param>
<param-name>statusEnabled</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Note that this rewrites internally somehow, not with a redirect. If I called, right after
deployment, a page with a not rewritten URL and an ajax4jsf tag on it, it would work fine.
Interesting enough but after it would work once, even pages that had rewritten URLs worked
fine. So there is some initialization issue hidden in this somewhere.
After reading this
http://jboss.com/index.html?module=bb&op=viewtopic&t=103561 I
started playing with random web.xml settings. Take a seam-gen WAR deployment web.xml and
make the following modifications:
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<url-pattern>*.seam</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
This seems to work now. I have no idea what happens.
Put this on the Java EE 6.0 list: web.xml must be replaced with something that makes
sense. Or we need to find a proprietary way to configure a stack of a dozen filters with
explicit URL pattern/precedence matching. Maybe we should move this into a Seam config
file and initialize the web container programmatically (if that is possible).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira