Struts2 -- struts. xml

Source: Internet
Author: User

[Html] <? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE struts PUBLIC "-// Apache Software Foundation // DTD Struts Configuration 2.0 // EN "" http://struts.apache.org/dtds/struts-2.0.dtd "> <Struts> <! -- Define a constant --> <! -- <Constant name = "struts. devMode "value =" true "/> --> <package name =" front "extends =" struts-default "namespace ="/front "> <action name =" index "> <result>/Namespace. jsp </result> </action> </package> <package name = "main" extends = "struts-default" namespace = "/main"> <action name = "index "class =" Test "> <result name =" main ">/Namespace. jsp </result> </action> </package> </struts> www.2cto.com <span style = "font-family: Arial; BACKGROUND-COLOR: # ffffff"> description: the package is equivalent to the java package, struts. multiple packages with different names can exist in xml. </span> [html] <span style = "font-family: Arial; BACKGROUND-COLOR: # ffffff "> extends is equivalent to the inheritance in java, where it inherits the built-in struts-default.xml file, </span> [html] <span style =" font-family: Arial; BACKGROUND-COLOR: # ffffff "> namespace is the access path, for example, <a href =" http://127.0.0.1:8080/ "> http://127.0.0.1:8080/ </A> project name/main/, </span> [html] <span style = "font-family: Arial; BACKGROUND-COLOR: # ffffff "> action corresponds to the class Name of the specific accessed Action, and the class is followed by the specific action class. </span> [html] <span style =" font-family: arial; BACKGROUND-COLOR: # ffffff "> result is the String value returned by the Action class. The default value is success (actually the value returned by the execute method) </span> [html] <span style = "font-family: Arial; BACKGROUND-COLOR: # ffffff"> </span>

Related Article

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.