(3) Resultive view: Hello.jsp
l The following is Hello.JSP rewritten with WebWork2
<% @ Taglib Uri = "Webwork" prefix = "ww"%>
p>
ww: iperator>
body>
html>
l WebWork2 resource beam mechanism
Ø WebWork2 disperse the resource bundle property file into each Action class, such as the webwork2 automatically finds the resource bundle required to find the SpringAppAction class in the SpringAppAction.properties with the SpringAppAction class.
Ø If there is no springappaction.properties, it will automatically drive from the parent class ActionSupport's property file ActionSupport.properties,
Ø Due to the ActionSupport class due to the Action class, it can be placed in ActionSupport.properties for public resource beams.
Ø In this example, all the resource bundles are placed in the COM / OpenSymphony / Xwork / ActionSupport.properties file.
l Use the resource bundle: You can use the
l Since WebWork2 has automatically pressed an action in the value stack (using OGNL) when executing the action (using OGNL), so the
l
(4) Configuration Action: WW2 / Web-INF / CLASSES / XWORK.XML
Class = "Web.SPRINGAPPACTION"> / web-inf / jsp / hello.jsp param> result> action> l Use the l l Ø dispatcher: forwards result to the specified location URL Ø Redirect: redirects result to the specified position URL; different from the dispatcher is not sending form data Ø Velocity: Use the Velocity template as a result, need to configure VelocityServlet in web.xml Ø Chain: Action chain, transfer the result to the next action Ø XSLT: Formatting results using XSLT l For Dispatcher type, use the Location parameter to specify the result view URL (5) Test procedure l Since JSTL is not used, use l In the browser, enter http: // localhost: 8888 / WW2, the entire execution process is as follows: Ø Show index.jsp; Ø The page is redirected to SpringApp.Action; Ø Servletdispatcher performs SpringAppAction in accordance with the MAP mapping and Action configuration; Ø Execute the execute () method of the springAppaction get data; Ø Redirect to the result view page hello.jsp According to the Action configuration Ø Display model data in Hello.jsp