struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haulyn R. Jason" <>
Subject Re: Issue with Url mapping with struts-action-extension=""
Date Mon, 04 Aug 2008 09:23:45 GMT
Jeromy Evans 写道:
> Haulyn R. Jason wrote:
>> Hi,all
>> I set struts-action-extension="" for no extension as "action" or "do" by
>> default for struts2, and mapping all url to struts2 dispatcher as "/*".
>> But, the problem is I can not access any jsp, html,css and js files. The
>> page display:there are no action mapping for XXX.jsp action.
>> Should any one give me some suggestions or referenced links? Always
>> thanks very much.
> I'm not sure if your setting is interpreted as blank, not set (default)
> or null.
> Did your jsp, html, css and js work before you made that change?
> The process works like this:
> 1. the container sees the request and maps it to the Strust2
> FilterDispatcher because it matches /*
> 2. the FilterDispatcher checks whether the request contains a known
> action extension, and if so, invokes the ActionMapper
> 3. If the ActionMapper didn't find anything, the FilterDispatcher checks
> if there's struts static resource for the request (if
> serve.static.resource=true)
> 4. If nothing matched, the filter does nothing
> 5. If nothing has processed the request, the container eventually
> invokes the Default Servlet (and JSP handling, other file handling)
> So there's two possible problems:
> a. the FilterDispatcher thinks it can handle everything and tries to,
> causing an error; or
> b. there is a configuration problem with the container (eg. the default
> servlet is disabled or the request never reached the container).
> In case it is a, I would try the following settings:
> struts.action.extension=,,action
> Note the double comma. That means a blank (no extension), or .action
> extension. The double-comma ensures blank isn't trimmed as whitespace.
> Hope that helps,
> Jeromy Evans
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
Hi, Evans

Thanks for your answer, it looks very useful but some new problem occurred:

When I set


value as "" with no space or " "(same as before with one whitespace)

Struts treat all html, js, css and jsp as action, but all real actions work well.

Without struts 2 FilterDispatcher, everything works well.(Certainly real action can not work)

Then I tried your solution as:

but modified as

ok, this time, when I visit http://localhost:8080/8f/myAction.jsps, everything works well,but
I can not access to 
http://localhost:8080/8f/myAction without any extension. 

And something interesting occurred: I can access "http://localhost:8080/8f/myAction." and
everything works well.
I mean, I can not visit myAction with no extension but I can visit myAction "with extension":".",
just a "."

I am not sure what's wrong with my configuration. And I use struts2.0.11.1.




Mobile: +086-15864011231

Haulyn Runner Jason

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message