Chris Pratt 写道: > In your web.xml, you told the system to send ALL requests to the > Struts Filter processor, so it's trying to map EVERYTHING including > *.css, *.js etc. You might want to try explicitly mapping those things > to the dispatcher before mapping the struts filter, that should make > them bypass struts as you want. > (*Chris*) > > 2008/8/4 Haulyn R. Jason <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> > > 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: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > > > > > > Hi, Evans > > Thanks for your answer, it looks very useful but some new problem > occurred: > > When I set > > "struts.action.extension=" > > 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: > struts.action.extension=,,action > > but modified as > struts.action.extension=,,jsps > > 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. > > > > > > -- > > Thanks! > > Mobile: +086-15864011231 > EMail>alk:[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > EMail&yahoo:[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > Skype:saharabear > > > Haulyn Runner Jason > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > Hi Chris Thanks for your answer, it's another good way. but: 1.How can I configure web.xml to exclude .css ,.js or other way? 2.If I use Evans' way, it looks worked well but just need a "."..Struts do not have a solution for these?
Thanks -- Thanks! Mobile: +086-15864011231 EMail>alk:[EMAIL PROTECTED] EMail&yahoo:[EMAIL PROTECTED] Skype:saharabear 贾昊林(Haulyn Runner Jason) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]