ActionServlet doesn't react when Action returns null
Hello all, my impression is, when an Action returns null like: ActionForward forward = mapping.findForward("some_forward"); // this forward is not declared in the configuration file !!! return forward; // return null; the ActionServlet does not react propper. It does not handle this situation. Wouldn't it be better to return a HTTP-Error ? Best regards, fm
Question regarding the autoFlush-Attrbute
Sorry for posting it to this list, but usually the response is overhelming. It seems, it is an inconsistence in the Tomcat 3.2.2 (b2) environment: If the page-directive autoflush is set to true %@ page autoFlash=true % and when the JSP uses a body-aware Tag class MyTag extends BodyTagSupport {...} the JSP-environment will generate a BodyContent ( which extends JspWriter) out = pageContext.pushBody(); This object does not inheritate the page-directive autoFlush. Is this conform to the JSP-specification or is this a bug ? Is there any way to programmatically set this attribute for all the sub-writers (for a specific writer ) ? Thanks in advance, fm
Re: Question on ActionServlet design
Hi Craig, Our web-app looks like: ActionServletMain ActionServletModule1ActionServletModule2 ... All of the controllers are living in the same web-app. The main controller is the only instance which knows about all the module-controllers. The communication between a module controller and the main controller is minimal. Each of the controllers has its own set of JSP/HTML-pages which are located in its own subfolders. The file structure looks like: %web-app%\ 'main' ui module1\ 'module1' ui module2\ 'module2' ui ... The reasons for the modularisation are: 1. each module can exist in its own web-app 2. each module is developed by a different group Each module has ist own extension-mapping. So the requests with the extension *.main are served by the ActionServletMain, and *.m1 by the ActionServletModule1 and so on. You mentioned: Craig::servlet context attributes set up by the ActionServlet instances that started first to Craig::be wiped out by the attributes created Craig::in the ActionServlet instance that started last ... Since we are using Struts just as a controller framework and are NOT using any Struts tags, are we on the safe side ? What are the smoking guns in such a model ? The attributes, that the ActionServlet is setting in the application and in the session scope (like Locale ) are they required for the controller part of Struts or for the Struts-tags ? Best Regards, fm
Are this bugs ?
Hello, I've noticed the following behaviour: declaring an Action like: actionpath="/logon" type="action.LogonAction" name="logonForm" input="/Logon.html" scope="request" validate="true" forward name="success" path="/showShops.do" / /action I'm getting a servlet exception and as a result the Logon.html file is overwritten (the file itself is still there but the content is gone). If I specify (instead of the extension .html) "/Logon.jsp" it works as expected. Just wondering: In the code of ActionServlet I've noticed that the access to the actions member in the method processActionCreate (in the try - block) is not synchronized. FM
RE: Are this bugs ?
Hello, I'm using tomcat4/milestone 4 (Struts nightly build from 06-Dec) the exception I'm getting: A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Servlet.service() for servlet default threw exception at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:537) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:292) at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:17 69) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1321) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:447) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:517) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:292) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja va:1468) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1334) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:447) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:180) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:255) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:165) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1876) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161 ) at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:343) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :159) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 785) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:902) at java.lang.Thread.run(Thread.java:484) Root Cause: java.lang.NullPointerException at org.apache.catalina.resources.FileResources.setResource(FileResources.java:5 86) at org.apache.catalina.servlets.DefaultServlet.doPut(DefaultServlet.java:401) at org.apache.catalina.servlets.DefaultServlet.doPost(DefaultServlet.java:365) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:517) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:292) at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:17 69) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1321) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:447) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:517) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:292) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja va:1468) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1334) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:447) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:180) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:255) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:165) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:1876) at
Access of application-wide declared parameters from Action/ActionForm
Hello, is there a convenient way to access the ServletContext from an Action or from an ActionForm ? My problem, I've declared a couple of context-param in the web.xml. Some of them have the meaning of beeing used as default-values in the JSP-page. I have now the problem to pass this parameters/values to my ActionForm. Thanks in advance, fm