I haven't written anything for a long time. I 've been taking an experiment over the past two days. Let's take a look at the following questions:
1. Regarding filterdispatcher filtering in struts2, the official filtering method is:/*. In fact, the default filtering method is *. action. You can use default in the struts2 core class library. properties (ORG/Apache/struts2 in the struts2-core-2.0.11.jar package) to find the definition:
...... <Br/>### used by the defaultactionmapper <br/> ### you may provide a comma separated list, e.g. struts. action. extension = action, JNLP, DO <br/> struts. action. extension = action <br/> ......
If you want to modify the file, I have read some documents about modifying this file and re-compile and generate a new jar package to replace it. However, this method is still quite troublesome. In fact, you can directly modify struts. XML, add a constant:
<Constant name = "struts. Action. Extension" value = "action, HTML, shtml"/>
2. Another student asked struts2 about struts2xml verification: After the XML verification framework provided in struts2.0 is used, error messages on the page are accumulated and submitted several times, several error messages are displayed. This is a good question. I will briefly discuss the solution:
The action class needs to implement the prepareable interface and implement the prepare method in it, and call the clearerrorsandmessage () method in the prepare method, so that everything is normal.