Hi everyone

What is the best practice to use REST url notation in Struts2 application ? 
Does anyone have successful solution ?


Below are my consideration about the available solutions:

I used /* filter mapping for struts filter and set 
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
<constant name="struts.action.extension" value=""/>
<constant name="struts.enable.SlashesInActionNames" value="true"/>
and tried all available mappers for constant "struts.mapper.class"  - 
DefaultActionMapper, RestfulActionMapper and  Restful2ActionMapper and 
everytime i had the same problem. 

Application is unable to serve static content (css, images, etc.) both from 
application directory and from /struts/*.

I read some FilterDispatcher and mappers code and i noticed that when 
"struts.action.extension" is empty all mappers return always instance of   
ActionMapping of action which doesn't exist. For example action 'xxx.jpg', but 
it should return null and then s2 provides static web content. Thats why i 
provide temporary own mapper which returns null when action name contains dot. 
But it is workaround solution.

I wondering why filter dispatcher do not check existence of mapping returned 
from ActionMapper and if it doesn't exist, behave as when ActionMapper is null. 
Probably it is faster for not empty "struts.action.extension" actions.

I found also solution to use /someName/* for struts filter dispatcher mapping, 
but i don`t want to use it.

--
Greetings
Mateusz Nowakowski



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to