Getting started with struts2.xml configuration file
<? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE struts PUBLIC "-// Apache Software Foundation // DTD Struts Configuration 2.3 // EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <! -- DMI dynamic method call! Followed by the method in action --> <constant name = "struts. enable. DynamicMethodInvocation" value = "true"/> <! -- To modify this page, you do not need to reload tomcat. During file upload, you must set value to false --> <constant name = "struts. devMode" value = "true"/> <! -- Do not change the name of the namespace differentiation module, if you change to/book and add the action --> <package name = "default" namespace = "/" extends = "struts-default"> <action name = "index"> <result>/index. jsp </result> </action> <! -- Default jump method After method --> <action name = "test" class = "com. cola. struts. test "method =" show "> <result>/test. jsp </result> </action> <! -- Add the wildcard * action and directly follow the method name --> <! -- <Action name = "book *" class = "com. cola. struts. bookAction "method =" {1} "> <result name =" success ">/{1 }. jsp </result> </action> --> <! -- * The Order corresponds to the number in {} --> <! -- <Action name = "* _ *" class = "com. cola. struts. {1} Action "method =" {2} "> <result name =" success ">/{1 }_{ 2 }. jsp </result> </action> --> <action name = "book" class = "com. cola. struts. bookAction "> <result name =" success ">/book_value.jsp </result> </action> <action name =" user "class =" com. cola. struts. userAction "> <result name =" success ">/book_value.jsp </result> </action> </package> <package name =" user "namespace ="/user "extends = "default"> <action name = "index"> <result>/test. jsp </result> </action> </package> </struts>