myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Byrne" <den...@dbyrne.net>
Subject Re: MyFaces seem to only work with one servlet-mapping set-up only in a web.xml file?
Date Fri, 05 May 2006 05:21:11 GMT
Do this ...

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

The URL pattern is context relative.  If a servlet could be to a specific context then it
could intercept requests sent for a different webapp.

Dennis Byrne

>-----Original Message-----
>From: Todd Patrick [mailto:Todd.Patrick@dtn.com]
>Sent: Friday, May 5, 2006 12:48 AM
>To: 'MyFaces Discussion'
>Subject: MyFaces seem to only work with one servlet-mapping set-up only in a web.xml file?
>
>I have the following current servlet-mapping that works:
> 
><filter>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
> 
><filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-
>class>
>    <init-param>
>        <param-name>maxFileSize</param-name>
>        <param-value>20m</param-value>
>    </init-param>
></filter>
><filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
>    <servlet-name>Faces Servlet</servlet-name>
></filter-mapping>
><filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
>    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
></filter-mapping>
> 
><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>
>
> 
>The only way I can develop or test my application is with the following
>URL:
> 
>http://127.0.0.1:8080/transactionbrowser/faces/
> 
>I'd like to just have the URL:
> 
>http://127.0.0.1:8080/transactionbrowser/ 
> 
> 
>If I change the servlet-mapping to:
> 
><filter>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
> 
><filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-
>class>
>    <init-param>
>        <param-name>maxFileSize</param-name>
>        <param-value>20m</param-value>
>    </init-param>
></filter>
><filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
>    <servlet-name>Faces Servlet</servlet-name>
></filter-mapping>
><filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
> 
><url-pattern>/transactionbrowser/myFacesExtensionResource/*</url-pattern
>>
></filter-mapping>
> 
><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>/transactionbrowser/*</url-pattern>
></servlet-mapping>
> 
>I receive the following error message:
> 
>javax.servlet.ServletException: No faces context?!
> 
> 
>What am I not understanding (again...)?
> 
>Thanks,
> 
>--Todd
> 
>Full Error:
>javax.servlet.jsp.JspException: No faces context?!
>	
>org.apache.myfaces.taglib.core.LoadBundleTag.doStartTag(LoadBundleTag.ja
>va:74)
>	
>org.apache.jsp.tbrowser_jsp._jspx_meth_f_loadBundle_0(tbrowser_jsp.java:
>197)
>	org.apache.jsp.tbrowser_jsp._jspService(tbrowser_jsp.java:105)
>	
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
>	
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
>va:336)
>	
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
>	
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
>	sun.reflect.GeneratedMethodAccessor328.invoke(Unknown Source)
>	
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25)
>	java.lang.reflect.Method.invoke(Method.java:585)
>	
>org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
>	java.security.AccessController.doPrivileged(Native Method)
>	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
>	
>org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
>	
>org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav
>a:165)
>	java.security.AccessController.doPrivileged(Native Method)
>	java.security.AccessController.doPrivileged(Native Method)
>	
>org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java
>:675)
>	
>org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:6
>42)
>	org.apache.jsp.index_jsp._jspService(index_jsp.java:118)
>	
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
>	
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
>va:336)
>	
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
>	
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
>	javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
>	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>	
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>a:39)
>	
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>Impl.java:25)
>	java.lang.reflect.Method.invoke(Method.java:585)
>	
>org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
>	java.security.AccessController.doPrivileged(Native Method)
>	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
>	
>org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
>	
>org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav
>a:165)
>



Mime
View raw message