Dizzy, the whole night, is unable to access, originally because of the use of the suffix ". Do. Change the suffix of ". Action" to access the service. And it can only be in the form of "XXX. Action". Otherwise, it cannot be accessed.
It seems that the filter mechanism of struts2 is not very clear.
However, I cannot set web. XML as follows:
<Filter-mapping>
<Filter-Name> struts2 </filter-Name>
<URL-pattern> *. DO </url-pattern>
</Filter-mapping>
I think this is not very good. We should be able to customize URL matching.
Why do I have to change it to the "struts. properties" file.
Since "structs. properties" is not modified, you can use the <constant> element in "struts. xml.
The method is as follows:
Add the red part in struts. xml:
<Struts>
......
<Constant name = "struts. Action. Extension" value = "do, Action"/>
......
</Struts>
The value attribute can be set to the desired suffix, value = "do, action", indicating that. Action and. Do can all be accessed.
You can also modify the structs. properties file to set:
You only need to modifyStruts. Action. ExtensionCan be separated by commas (,). For example, "struts. Action. Extension = Do, Action"