Another bit of information. I found the source of the problem, but I am not sure if anything can be done about it :(
With INCLUDE dispatcher mapping, StripesFilter gets on the stack twice (which is correct since it is mapped to FORWARD and INCLUDE), but once <jsp:include/> is processed StripesFilter cleans it's ThreadLocal configuration and that causes major problems up the chain since there is another reference tStripesFilter sitting on the same thread; anything that needs Stripes configuration would generate exception. -----Original Message----- From: Leonard Gestrin [mailto:[email protected]] Sent: Sunday, February 01, 2009 10:12 PM To: Stripes Users List Subject: [Stripes-users] simple case to demonstrate the problem RE: question about layout, <jsp:include src"/test.action> and stripes filter configuration (dispatcher directive) Hi, I narrowed it down to the following case, and I want to confirm if it is known issue. If stripesfilter 's mapping has INCLUDE dispatcher and action forwards to jsp that has include followed by stripes form, there is an exception bad_Test.jsp <jsp:include page="/PortalLogo.action"/> <stripes:form action="/test.action" id = "test"> <stripes:hidden name="test"/> </stripes:form> Stack trace: Caused by: java.lang.NullPointerException at net.sourceforge.stripes.tag.FormTag.setAction(FormTag.java:74) at org.apache.jsp.WEB_002dINF.jsp.common.test_jsp._jspx_meth_stripes_form_0(test_jsp.java:95) at org.apache.jsp.WEB_002dINF.jsp.common.test_jsp._jspService(test_jsp.java:71) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) good_Test.jsp <%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %> <stripes:form action="/test.action" id = "test"> <stripes:hidden name="test"/> </stripes:form> <jsp:include page="/PortalLogo.action"/> If I comment out INCLUDE dispatcher, both jsps work fine. It appears that in the first case, StripesFilter is not on the stack at the time of processing stripes:form tag. This is stripes 1.4.3 - is it a known issue/new bug/ user error? I can also verify the same with stripes 1.5, if needed. Thanks -----Original Message----- From: Leonard Gestrin [mailto:[email protected]] Sent: Friday, January 30, 2009 8:29 PM To: Stripes Users List Subject: [Stripes-users] question about layout, <jsp:include src"/test.action> and stripes filter configuration (dispatcher directive) Hello, I am hitting a problem that I cant quite understand. My goal is to have StripesFilter on the stack ahead of ServletDispatcher so that if <jsp:include src="bad.action/"> throws runtimeexception, I have a chance to process runtime exception as oppose to having ServletDispatcher.service logging it and then passing it ExceptionHandler. Currently, I have stripesfilter configured as <filter-mapping> <filter-name>StripesFilter</filter-name> <url-pattern>*.action</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <!--<dispatcher>INCLUDE</dispatcher> --> </filter-mapping> When I uncomment INCLUDE dispatcher, I am getting errors during processing of layout tag that StripesRunTimeConfigurration is not available, even if there are no exceptions in the app, which is surprising. When INCLUDE dispatcher is commented out, everything works fine except for the cases when Action forwards to jsp which is part of layout and also contains jsp:include to another action that throws runtime exception - basically, I am getting noise in the logs. The flow is like this http:/test.action forwards to jsp, which part of layout (which is part of another layout) and also contains "jsp:include bad.action/>" that throws runtime that gets to StripesFilter after ServletDispatcher servlet if anyone have ideas why uncommenting INCLUDE causes such grief to stripes and/or how to put StripesFilter ahead in such situations ahead on the stack, please let me know. thanks ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
