Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes [Solved] Upgrading to Struts 2... nothing happens Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[Solved] Upgrading to Struts 2... nothing happens" Watch "[Solved] Upgrading to Struts 2... nothing happens" New topic

[Solved] Upgrading to Struts 2... nothing happens

Ryan Silva

Joined: Nov 04, 2009
Posts: 7
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 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.

Ryan Silva

Joined: Nov 04, 2009
Posts: 7
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

to true in Application Servers > server1 > Web container > Custom Properties

I found this here:

Also, a sort of related fixpack is listed on the IBM site here:

More specifically,

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':
I agree. Here's the link:
subject: [Solved] Upgrading to Struts 2... nothing happens
jQuery in Action, 3rd edition