I am in the middle of upgrading from mojarra 1.2 to myfaces 2. Using the t:dataScroller tag is generating the following error :
java.io.FileNotFoundException: /WEB-INF/javax.faces.resource/oamSubmit.xhtml Not Found in ExternalContext as a Resource
Code snippet:
<t:dataScroller id="${name}" for="#{forTable}"
fastStep="10"
pageIndexVar="pageIndex"
paginator="true"
paginatorMaxPages="10"
pageCountVar="pageCountVar"
rowsCountVar="rowsCountVar"
firstRowIndexVar="firstRowIndexVar"
lastRowIndexVar="lastRowIndexVar"
rowIndexVar="rowIndexVar"
paginatorRenderLinkForActive="false"
>
The generated javascript snippet for my page is as follows:
.. src="/app/javax.faces.resource/oamSubmit.js?ln=org.apache.myfaces"> ..
I'm guessing somewhere along the line oamSubmit is being returned as a facelet tag instead of javascript. I thought it might be a configuration parameter, but have yet to find the correct value.
Web.xml snippets:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
faces-config.xml
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
Updated: More stack trace details:
WEB-INF/javax.faces.resource/oamSubmit.xhtml Not Found in ExternalContext as a Resource at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:227) at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:170) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage._getFacelet(FaceletViewDeclarationLanguage.java:2530) at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.buildView(FaceletViewDeclarationLanguage.java:435) at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:77) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241) at org.springframework.faces.mvc.JsfView.renderMergedOutputModel(JsfView.java:85) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
And dispatcher servlet params in web.xml
<servlet>
<servlet-name>myApp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>myApp</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
I think I need to tell the Dispatcher to serve static content as is, rather than an JSF.
I set the context parameters to true in my web.xml.
That seemed to do the trick. Of course I still have other problems, but I think they are un-related .