Re: Struts2 Not Executing Actions
Actually I figured it out. I didn't realize that S2 was expecting struts.xml to be on the classpath. I put it in WEB-INF. The wiki page http://cwiki.apache.org/WW/strutsxml.html didn't make it clear that it is required to be on the classpath. It does however state that the struts-plugin.xml needs to be on the classpath. I should have made the connection sooner. I have used Struts 1.2.x in the past and WEB-INF is the default location for a Struts config file. Sorry I didn't "close" this thread. Thanks though. Ian Roughley wrote: Can you verify that the struts.xml is in the WAR file, and the location of it? /Ian Danny Hurlburt wrote: Hello, I am new to Struts2 and am running into some problems. I have read much of the documentation on the wiki but I am still stuck. I have added the filter declaration and filter mapping to web.xml. I have confirmed that it gets invoked by setting a breakpoint in the doFilter method. I have created the following struts.xml: http://struts.apache.org/dtds/struts-2.0.dtd";> /HelloWorld.jsp I don't have a struts.properties file. I have not set any init-params for the Struts2 filter in web.xml. That is, the default constant configuration is in effect. This is running in a web app with a context path of rgg. When making the following request http://localhost:7070/rgg/HelloWorld.action I get the following stack trace (trimmed down for brevity): There is no Action mapped for namespace / and action name HelloWorld. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421) Has anyone else run into the same problem? Anyone have a solution? Thanks - Dan PS - I there anyway I can search the user mailing list before I post questions to see if someone else has previously solved my problem or similar issue? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Could not parse struts.locale setting
I was getting the same warning. I was able to remove the warning by creating a /WEB-INF/classes/struts.properties file with struts.locale=en_GB I am however not able to set the locale via the constant element in struts.xml althought the documentation at http://struts.apache.org/2.0.6/docs/constant-configuration.html states that you can. Torsten Römer wrote: Everytime my app starts, I see this in the log: 13.06.2007 23:50:27 org.apache.struts2.config.Settings getLocale WARNUNG: Settings: Could not parse struts.locale setting, substituting default VM locale I put in my struts.xml, but I still get the error (and the default VM locale is used, which I don't want) Torsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 Not Executing Actions
Hello, I am new to Struts2 and am running into some problems. I have read much of the documentation on the wiki but I am still stuck. I have added the filter declaration and filter mapping to web.xml. I have confirmed that it gets invoked by setting a breakpoint in the doFilter method. I have created the following struts.xml: http://struts.apache.org/dtds/struts-2.0.dtd";> /HelloWorld.jsp I don't have a struts.properties file. I have not set any init-params for the Struts2 filter in web.xml. That is, the default constant configuration is in effect. This is running in a web app with a context path of rgg. When making the following request http://localhost:7070/rgg/HelloWorld.action I get the following stack trace (trimmed down for brevity): There is no Action mapped for namespace / and action name HelloWorld. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421) Has anyone else run into the same problem? Anyone have a solution? Thanks - Dan PS - I there anyway I can search the user mailing list before I post questions to see if someone else has previously solved my problem or similar issue? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FilterDispatcher not being invoked with URL pattern /*
Does anyone know if it true that if the Struts FilterDispatcher finds a match for an action that the matching servlet is not invoked? That is, will it will skip calling chain.doFilter(...) on the FilterChain object when it finds a match? I have not looked at the source code yet. Danny Hurlburt wrote: Hello, I am using Tomcat 5.5 as my servlet container. I have added the org.apache.struts2.dispatcher.FilterDispatcher as a filter with a url pattern of /*. struts2 org.apache.struts2.dispatcher.FilterDispatcher When following the HelloWorld example on the Strut's wiki (http://struts.apache.org/2.x/docs/hello-world.html) I could not get the filter to run. I set a break point in the doFilter method. Then I would call http://localhost:8080/cntxPath/HelloWorld.action but the filter is never invoked. The filter is however invoked if I request http://localhost:8080/cntxPath/HelloWorld.jsp since this request maps to the JSP servlet (but of course the filter won't invoke an action class and will simply let the JSP servlet write to the response). The problem seems to be that since I don't have any servlet mappings that will match http://localhost:8080/cntxPath/HelloWorld.action the filter is never invoked. I don't have Tomcat's "default" servlet (which is mapped to /) enabled. However when I do enable this, the request http://localhost:8080/cntxPath/HelloWorld.action causes the filter to be invoked an it attempts to find an action mapping to HelloWorld. I have read the Servlet 2.4 spec and it sounds like filters will only be called if the URI matches some servlet mapping AND the URI matches the filter mapping. Since I don't have a servlet that would get invoked using http://localhost:8080/cntxPath/HelloWorld.action the Struts filter never gets invoked (unless I enable Tomcat's default servlet which I don't want to do). It sounds like Tomcat is doing what it suppose to do by not invoking the Struts filter because there are no servlets matching any servlet mappings. I believe I can solve this problem with a No-op servlet mapped to /*. This would be similar to enabling Tomcat's default servlet. Has anybody else ran into this problem? Anybody have any solutions? Thanks, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FilterDispatcher not being invoked with URL pattern /*
I have added a filter mapping. See the second sentence of the original post. The problem is that according to the Servlet Spec (at least my understanding of it) "Filters can be associated with groups of servlets and static content using the style of filter mapping". Since the Struts actions aren't static content (they may however end up serving static content) and I don't have any servlet mappings that would match for instance "HelloWorld.action" it appears my only option is to make a "No-Op" servlet and map is to "/*". The problem with the "No-Op" servlet is that I won't receive 404s anymore. I suppose that instead of a "No-Op" servlet I could make a "404" servlet. Jeromy Evans wrote: I have plenty of S2 webapps that don't include a servlet in web.xml and haven't encountered this problem. Have you included a filter mapping instead? web.xml: 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"; > struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* Danny Hurlburt wrote: Hello, I am using Tomcat 5.5 as my servlet container. I have added the org.apache.struts2.dispatcher.FilterDispatcher as a filter with a url pattern of /*. struts2 org.apache.struts2.dispatcher.FilterDispatcher When following the HelloWorld example on the Strut's wiki (http://struts.apache.org/2.x/docs/hello-world.html) I could not get the filter to run. I set a break point in the doFilter method. Then I would call http://localhost:8080/cntxPath/HelloWorld.action but the filter is never invoked. The filter is however invoked if I request http://localhost:8080/cntxPath/HelloWorld.jsp since this request maps to the JSP servlet (but of course the filter won't invoke an action class and will simply let the JSP servlet write to the response). The problem seems to be that since I don't have any servlet mappings that will match http://localhost:8080/cntxPath/HelloWorld.action the filter is never invoked. I don't have Tomcat's "default" servlet (which is mapped to /) enabled. However when I do enable this, the request http://localhost:8080/cntxPath/HelloWorld.action causes the filter to be invoked an it attempts to find an action mapping to HelloWorld. I have read the Servlet 2.4 spec and it sounds like filters will only be called if the URI matches some servlet mapping AND the URI matches the filter mapping. Since I don't have a servlet that would get invoked using http://localhost:8080/cntxPath/HelloWorld.action the Struts filter never gets invoked (unless I enable Tomcat's default servlet which I don't want to do). It sounds like Tomcat is doing what it suppose to do by not invoking the Struts filter because there are no servlets matching any servlet mappings. I believe I can solve this problem with a No-op servlet mapped to /*. This would be similar to enabling Tomcat's default servlet. Has anybody else ran into this problem? Anybody have any solutions? Thanks, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FilterDispatcher not being invoked with URL pattern /*
Hello, I am using Tomcat 5.5 as my servlet container. I have added the org.apache.struts2.dispatcher.FilterDispatcher as a filter with a url pattern of /*. struts2 org.apache.struts2.dispatcher.FilterDispatcher When following the HelloWorld example on the Strut's wiki (http://struts.apache.org/2.x/docs/hello-world.html) I could not get the filter to run. I set a break point in the doFilter method. Then I would call http://localhost:8080/cntxPath/HelloWorld.action but the filter is never invoked. The filter is however invoked if I request http://localhost:8080/cntxPath/HelloWorld.jsp since this request maps to the JSP servlet (but of course the filter won't invoke an action class and will simply let the JSP servlet write to the response). The problem seems to be that since I don't have any servlet mappings that will match http://localhost:8080/cntxPath/HelloWorld.action the filter is never invoked. I don't have Tomcat's "default" servlet (which is mapped to /) enabled. However when I do enable this, the request http://localhost:8080/cntxPath/HelloWorld.action causes the filter to be invoked an it attempts to find an action mapping to HelloWorld. I have read the Servlet 2.4 spec and it sounds like filters will only be called if the URI matches some servlet mapping AND the URI matches the filter mapping. Since I don't have a servlet that would get invoked using http://localhost:8080/cntxPath/HelloWorld.action the Struts filter never gets invoked (unless I enable Tomcat's default servlet which I don't want to do). It sounds like Tomcat is doing what it suppose to do by not invoking the Struts filter because there are no servlets matching any servlet mappings. I believe I can solve this problem with a No-op servlet mapped to /*. This would be similar to enabling Tomcat's default servlet. Has anybody else ran into this problem? Anybody have any solutions? Thanks, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]