alright. Maybe the problem is my Filter. I have a (Authentication-)Filter 
installed. If the branch
            request.getRequestDispatcher(fwd).forward(request, response);
  | 
is being called, the NPE occurs. If the branch
            chain.doFilter(request, response);
  | 
is being called, the seam processes the request properly.

web.xml is:

<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <web-app  xmlns="http://java.sun.com/xml/ns/j2ee"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4">
  |    <distributable/>
  | 
  |       <filter>
  |         <filter-name>Seam Redirect Filter</filter-name>
  |         
<filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
  |     </filter>
  | 
  |     <filter>
  |         <filter-name>Seam Exception Filter</filter-name>
  |         
<filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
  |     </filter>
  | 
  |    <filter>
  |       <filter-name>Authentication</filter-name>
  |       
<filter-class>de.ems.dap.appengine.web.AuthenticationFilter</filter-class>
  |       <init-param>
  |          <param-name>failedForward</param-name>
  |          <param-value>/login.seam</param-value>
  |       </init-param>
  |    </filter>
  | 
  |     <filter-mapping>
  |         <filter-name>Seam Redirect Filter</filter-name>
  |         <url-pattern>*.seam</url-pattern>
  |     </filter-mapping>
  | 
  |    <filter-mapping>
  |       <filter-name>Authentication</filter-name>
  |       <url-pattern>/noch-nicht*</url-pattern>
  |    </filter-mapping>
  | 
  |       <listener>
  |         
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  |     </listener>
  | 
  |     <!-- beginn workaround ... es gibt hierfuer keine andere moeglichkeit, 
es ueber xdoclet einzusteuern -->
  |     <context-param>
  |         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  |         <param-value>client</param-value>
  |     </context-param>
  |     <!-- ende workaround -->
  | 
  |     <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>*.seam</url-pattern>
  |     </servlet-mapping>
  | 
  |    <!--
  |    To specify mime mappings, create a file named mime-mappings.xml, put it 
in your project's mergedir.
  |    Organize mime-mappings.xml following this DTD slice:
  | 
  |    <!ELEMENT mime-mapping (extension, mime-type)>
  |    -->
  | 
  |    <!--
  |    To specify error pages, create a file named error-pages.xml, put it in 
your project's mergedir.
  |    Organize error-pages.xml following this DTD slice:
  | 
  |    <!ELEMENT error-page ((error-code | exception-type), location)>
  |    -->
  | 
  |   <!--
  |   To add taglibs by xml, create a file called taglibs.xml and place it
  |   in your merge dir.
  |   -->
  | 
  |    <!--
  |    To set up security settings for your web app, create a file named 
web-security.xml, put it in your project's mergedir.
  |    Organize web-security.xml following this DTD slice:
  | 
  |    <!ELEMENT security-constraint (display-name?, web-resource-collection+, 
auth-constraint?, user-data-constraint?)>
  |    <!ELEMENT web-resource-collection (web-resource-name, description?, 
url-pattern*, http-method*)>
  |    <!ELEMENT web-resource-name (#PCDATA)>
  |    <!ELEMENT url-pattern (#PCDATA)>
  |    <!ELEMENT http-method (#PCDATA)>
  |    <!ELEMENT user-data-constraint (description?, transport-guarantee)>
  |    <!ELEMENT transport-guarantee (#PCDATA)>
  | 
  |    <!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
  |    <!ELEMENT auth-method (#PCDATA)>
  |    <!ELEMENT realm-name (#PCDATA)>
  |    <!ELEMENT form-login-config (form-login-page, form-error-page)>
  |    <!ELEMENT form-login-page (#PCDATA)>
  |    <!ELEMENT form-error-page (#PCDATA)>
  |    -->
  | 
  | </web-app>
  | 
AuthenticationFilter is:
package de.ems.dap.appengine.web;
  | 
  | import java.io.IOException;
  | 
  | import javax.servlet.Filter;
  | import javax.servlet.FilterChain;
  | import javax.servlet.FilterConfig;
  | import javax.servlet.ServletException;
  | import javax.servlet.ServletRequest;
  | import javax.servlet.ServletResponse;
  | import javax.servlet.http.HttpServletRequest;
  | import javax.servlet.http.HttpSession;
  | 
  | import de.ems.dap.appengine.business.AppSession;
  | 
  | /**
  |  * Filter class
  |  *
  |  * @web.filter              name="Authentication"
  |  * @web.filter-mapping      url-pattern="/*"
  |  * @web.filter-init-param
  |  *       name="failedForward"
  |  *       value="/login.seam"
  |  */
  | public class AuthenticationFilter implements Filter {
  | 
  |     //private static org.apache.commons.logging.Log log = 
org.apache.commons.logging.LogFactory.getLog(AuthenticationFilter.class);
  |     private String                           authenticationFailedForward;
  | 
  |     public AuthenticationFilter() {
  |     }
  | 
  |     public void init(FilterConfig cfg) throws ServletException {
  |         authenticationFailedForward = cfg.getInitParameter("failedForward");
  |     }
  | 
  |     public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain) throws IOException, ServletException {
  | 
  |         HttpSession session = ((HttpServletRequest) 
request).getSession(true);
  |             AppSessionHolder ash = AppSessionHolder.getInstance(session);
  |             
  |             AppSession as = null;
  |             if(ash!=null) {
  |                     ash.getAppSession();
  |             }
  |         boolean     ok      = (as!=null);
  | 
  |         String url           = ((HttpServletRequest) 
request).getServletPath();
  |         ok |= url.startsWith("/login.");
  |         ok |= url.startsWith("/logout.");
  |         ok |= url.startsWith("/life-check.");
  |         
  |         if (ok) {
  |             chain.doFilter(request, response);
  |         } else {
  |             String fwd = authenticationFailedForward;
  | 
  |             request.getRequestDispatcher(fwd).forward(request, response);
  |         }
  |     }
  | 
  |     public void destroy() {
  |     }
  | 
  | }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3951920#3951920

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3951920


_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to