Struts2 result configuration details

Source: Internet
Author: User
Tags xslt

Description: In many previous cases, the action we used basically inherits from the actionsupport class. In this class, we define five fields: Success, none, error, input, loging. We can directly return these field values, which are defined in the form of string success = "success", so we only need to use them in lower case in the result element.
<Result> the complete standard format is as follows:

<Result
Name = "success"
Type = "dispatcher">

<Param
Name = "location">/Default. jsp </param>

</Result>

If we use the default format, we can end up with: <result>/Default. jsp </result>

Type type:

Type Value

Description

Corresponding class

Chain

Used to process the action chain

Com. opensymphony. xwork2.actionchainresult

Dispatcher

It is used to redirect to a page.

Org. Apache. struts2.dispatcher. servletdispatcherresult

Redirect

Redirect to a URL

Org. Apache. struts2.dispatcher. servletredirectresult

Redirectaction

Redirect to an action

Org. Apache. struts2.dispatcher. servletactionredirectresult

Plaintext

Displays the source file content, such as the source code.

Org. Apache. struts2.dispatcher. plaintextresult

Freemarker

Process freemarker templates

Org. Apache. struts2.views. freemarker. freemarkerresult

Httpheader

Result type that controls special HTTP Behaviors

Org. Apache. struts2.dispatcher. httpheaderresult

Stream

Sends an inputsream object to a browser, which is usually used to process file downloads and return Ajax data.

Org. Apache. struts2.dispatcher. streamresult

Velocity

Process the velocity Template

Org. Apache. struts2.dispatcher. velocityresult

XSLT

Process XML/XLST templates

Org. Apache. struts2.views. XSLT. extends tresult

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.