Hi, I've read multiple tutorials on struts 2 and looked at multiple helloWorld apps. I'm sure I have everything set up right but I'm getting 404 File Not Found errors every time I try to access a URL that I think should go through struts. So obviously it's not set up right. I must not even have logging configured properly because I don't even see struts mentioned in the logs. All my search results for struts logging show me how to print log messages in a struts app but that's not what I need. I already have a log4j.properties file.
Here's my setup
web.xml has the following:
I have a struts.xml inside web-inf/classes:
and there is a struts2.jsp which I can access in the browser at the context root of the app.
This is a preexisting web app which is running in WebSphere and I have commented out every other filter and filter mapping in web.xml including even struts1.
I'm pretty stuck here because like I said I can't even see any errors in SystemOut.log--it's as if I didn't have the filter in web.xml in the first place.
Joined: Nov 04, 2009
Solved... it's a nasty Websphere bug.
Struts 2 uses a filter instead of a servlet, and apparently there is a WAS bug that prints 404 errors instead of letting the filter control things. The fix is to set
The Webcontainer code has been modified to not send back a 404 FileNotFoundException, in response to a request for a nonexistent static file, if a filter effectively completes the request by not calling the next filter in the chain. Note that for the filters to be called when a static file which is a target of a request and does not exist, the following Webcontainer custom property must be set to 'true':