Xwork. xml

Source: Internet
Author: User
Tags xml example

Example of xwork DTD <! --
Xwork configuration DTD.
Use the following doctype

<! Doctype xwork public
"-// Opensymphony group // xwork 1.1.1 // en"
Http://www.opensymphony.com/xwork/xwork-1.1.1.dtd>
-->

<! Element xwork (package | include) *>

<! Element package (result-types ?, Interceptors ?, Default-interceptor-ref ?, Default-action-ref ?, Global-results ?, Global-exception-mappings ?, Action *)>
<! ATTLIST package
Name CDATA # required
Extends CDATA # implied
Namespace CDATA # implied
Abstract CDATA # implied
Externalreferenceresolver nmtoken # implied
>

<! Element result-types (result-type +)>

<! Element result-type (Param *)>
<! ATTLIST result-type
Name CDATA # required
Class CDATA # required
Default (true | false) "false"
>

<! Element interceptors (interceptor | Interceptor-stack) +>

<! Element Interceptor (Param *)>
<! ATTLIST interceptor
Name CDATA # required
Class CDATA # required
>

<! Element Interceptor-stack (Interceptor-ref +)>
<! ATTLIST Interceptor-Stack
Name CDATA # required
>

<! Element Interceptor-ref (Param *)>
<! ATTLIST Interceptor-ref
Name CDATA # required
>

<! Element default-interceptor-ref (Param *)>
<! ATTLIST default-interceptor-ref
Name CDATA # required
>

<! Element default-action-ref (Param *)>
<! ATTLIST default-action-ref
Name CDATA # required
>

<! Element external-ref (# pcdata)>
<! ATTLIST external-ref
Name nmtoken # required
Required (true | false) "true"
>

<! Element global-results (result +)>

<! Element global-exception-mappings (exception-mapping +)>

<! Element Action (Param | result | Interceptor-ref | exception-mapping | external-ref) *>
<! ATTLIST action
Name CDATA # required
Class CDATA # implied
Method CDATA # implied
Converter CDATA # implied
>

<! Element param (# pcdata)>
<! ATTLIST Param
Name CDATA # required
>

<! Element result (# pcdata | PARAM) *>
<! ATTLIST result
Name CDATA # implied
Type CDATA # implied
>

<! Element exception-mapping (# pcdata | PARAM) *>
<! ATTLIST exception-Mapping
Name CDATA # implied
Exception CDATA # required
Result CDATA # required
>

<! Element include (# pcdata)>
<! ATTLIST include
File CDATA # required
>

 

Xwork. xml example <xwork>
<Include file = "webwork-default.xml"/>

<Package name = "person" extends = "webwork-Default" namespace = "/person">
<Action name = "listpeople" class = "com. opensymphony. webwork. Showcase. Person. listpeople">
<Interceptor-ref name = "validationworkflowstack"/>
<Result type = "freemarker"> listpeople. FTL </result>
</Action>

<! -- Our jasperreports example -->
<Action name = "jasperlist" class = "com. opensymphony. webwork. Showcase. Jasper. jasperaction">
<Result name = "success" type = "Jasper">
<Param name = "location">/Jasper/sample_report.jasper </param>
<Param name = "datasource"> People </param>
<Param name = "documentname"> peoplereport </param>
</Result>
</Action>


<Action name = "newperson" class = "com. opensymphony. webwork. Showcase. Person. createperson">
<Result type = "Redirect"> listpeople. Action </result>
<Result name = "input" type = "freemarker"> newperson. FTL </result>
</Action>

<Action name = "editperson" class = "com. opensymphony. webwork. Showcase. Person. editperson">
<Result> editpeople. jsp </result>
</Action>

<Action name = "doeditperson" class = "com. opensymphony. webwork. Showcase. Person. editperson" method = "save">
<Result name = "error"> editpeople. jsp </result>
<Result type = "Redirect"> listpeople. Action </result>
</Action>
</Package>
</Xwork>
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.