Struts2 struts.xml result
Jul 28, 2013 Struts 2 Result Types. The dispatcher result type: The dispatcher result type is the default type, and is used if no other result type is specified. Its used to forward to a servlet, JSP, HTML page, and so on, on the server. It uses the method. We saw the shorthand version in our earlier examples,Action redirect in struts. xml. This last one is probably what you want. Now a warning, chainingaction redirection is up there with the goto statement. Not evil but easy to abuse, you should probably look to moving the deciding logic (the logic that determines what action to call of several to an interceptor) or if the logic is mostly setup struts2 struts.xml result
The Srruts2 framework provides set of Result types like; chaining, dispatcher, redirect action, velocity and freemarket etc, that has to be configure in struts. xml for different kind of result. The result type is used to change the behaviour of view page to render the contents of action class.
Chain Action Result: In the action chaining the multiple actions can be executed in defined sequence. And the target view page will be displayed after last action. In the chain result type, the target resource will be any action which is already configured in struts. xml file. It resembles the chain interceptor of previous chapter. As when request come business logic is executed first and after that result is to display as view. Struts provide a number of predefined result types. The dispatcher is the default result type. The tag is used to specify a result type in sturts. xml. The dispatcher, FreeMaker and redirect are the commonly used result types. login. jsp.struts2 struts.xml result Struts2 PlainText result type. plainText: It is used to display raw content of a file in the browser. Lets demostrate plainText result type. Follow the following steps to create this project: Step 1: Create a Dynamic Web Project in eclipse Step 2: Edit deployment descriptor web. xml.