How to specify multiple struts profiles for an app

Source: Internet
Author: User

How to specify multiple struts profiles for an app
In most applications, as the scale of the application increases,
The number of actions in the system also increases greatly, causing the Struts.xml configuration file to become very bloated,
In order to avoid struts.xml files too large, bloated, improve the readability of struts.xml files,
We can break a struts.xml configuration file into multiple profiles,
Then the Struts.xml file contains additional configuration files.

Specifying multiple profiles with the <include> element
<struts>
<include file= "Department.xml"/> A module using one profile
<include file= "Employee.xml"/>
</struts>

--------------------------------------------------------------------------------------------------------

Dynamic Method Invocation
Define an action with a wildcard character *
<package name= "Employee" namespace= "/control/employee" extends= "Struts-default" >
<action name= "list_*" class= "cn.itcast.action.HelloWorldAction" method= "{1}" >
<result name= "Success" >/WEB-INF/page/message.jsp</result>
</action>
</package>
Dynamic invocation of a method via wildcard characters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.