G'day,

This is probably the suck, but:

template.jsp:
<[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %>
<[EMAIL PROTECTED] import='com.opensymphony.xwork2.ActionContext' %>
<html>
 <head>
   <title>
      <s:property value="title" default="Some default title"/>
   </title>
 </head>
 <body>
 <div class="header">
     Some header stuf
 </div>
 <%!
String actionname=(String)ActionContext.getContext().get(ActionContext.ACTION_NAME);
%>
   <div class="bodytext">
       <s:include value="<%= actionname + ".jsp"%>"/>
   </div>
  <div class="footer">
     Footer stuff
  </div>
 </body>
</html>

With a default action that looks like:
<action name="*" class="com.foo.web.{1}">
 <result>template.jsp</result>
</action>

Now, you've gotta do a bit more in the template JSP to deal with actions like foo_input... But that's kinda the idea...

PK

Ståle Undheim wrote:
Currently, all my jsp pages are structured like this:
* identical html header and <body> tag ...
* page specific content
* identical trail of </body> and </html>

Instead of copying this for every file, I would like to have 1 common
outer wrapper file, that includes a jsp based on the action or
something.

I have been looking at the tiles plugin, but I couldn't make out
enough from the documentation to see how I could use it.

My ideal solution would be something like having a layout.jsp that
looks like this:
<DOCTYPE>
<html>
<head></head>
<body>
<% include jsp based on ActionName or an annotation, or that I can set
with an interceptor of sorts. %>
</body>
</html>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to