Using a Tile as an ActionForward

 < Day Day Up > 



You probably did not realize this, but when you installed the Tiles Plugin you installed a custom request processor. This custom request processor extends the way Struts handles ActionForward. This means that you can forward to a Tile definition instead of a JSP page.

Let's say you have this definition:

   <definition name="main.index" extends="siteLayoutDef7">     <put name="content" value="/indexContent.jsp"/>   </definition> 

In your Struts configuration file, you can define a forward that forwards to the main.index definition instead of specifying a JSP page:

     <action                     path="/Lookup"                     type="ch13.SimpleLookupAction"                     name="lookupForm"                     input="/index.jsp">              <forward name="success" path="/quote.jsp"/>              <!-- forward name="failure" path="/index.jsp"/ -->              <forward name="failure" path="main.index" />     </action> 



 < Day Day Up > 



Professional Jakarta Struts
Professional Jakarta Struts (Programmer to Programmer)
ISBN: 0764544373
EAN: 2147483647
Year: 2003
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net