struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Holman, Cal" <Cal.Hol...@paymentech.com>
Subject RE: Action Under a Tile?
Date Sat, 19 Jul 2003 17:15:32 GMT
Have you tried using a TilesAction?  Using an action tied to a definition allow for the building
of independent jsps - they not only have the html but they have an action attached to them
that can load any beans necessary for rendering.  You can then drop into any definition or
template a self contained tile.

  <definition 	name="portal.whatsnew.pagedef" 
  				controllerUrl="/do/portalWhatsNew" 
  	path="/web/pages/portal/PortalWhatsNew.jsp"/>

This page definition will call the /do/portalWhatsNew action - loading a bean with the news
items then insert the PortalWhstsNew.jsp that uses the bean from the tiles action to populate
a list of what's new items.  This way you can use the definition as an attribute in any other
definitions and not worry about the action rendering the 'real' page loading the what's new
items - the definition is a self defining jsp - action and jsp together.  If you then wrap
something like the OSCache around this definition in the master jsp template you only have
to create the jsp the first time.

  <definition name="home.pagedef" 	extends="layouts.pagedef" >   
	  <put name="title"  					value="home.title" />
	  <put name="header" 				value="/web/includes/header.jsp" />
	  <put name="index"   				value="/web/pages/home/HomeIndex.jsp" />
	  <put name="indexMain"   		value="/web/includes/index.jsp" />
	  <put name="content"   			value="/web/pages/home/HomeContent.jsp" />
	  <put name="footer" 				value="/web/includes/footer.jsp" />
    	  <put name="styleSheet" 			value="web/styles/Grey_StyleSheet.css" />
    	  <put name="keywords" 			value="home.keywords"/>
    	  <put name="crumbs" 				value="/web/includes/crumb.jsp"/>
	  <put name="crumbtitle1" 			value="Home"/>
	  <put name="crumblink1" 			value="/home/home"/>
	  <put name="pagename"			value="home"/>
	   <put name="defname"			value="home.pagedef"/>
	  
	  <put name="rightIndex" value="portal.whatsnew.pagedef"/>
  </definition>

And in the template jsp:

               <td valign="top" class="IndexFill">
               <oscache:cache key="portal">
               <!-- **********Begin Right Navigation ********** -->
                  <tiles:insert attribute="rightIndex" flush="false"/>
               <!-- **********End Right Navigation ********** -->
               </oscache:cache>
               </td>


Cal

-----Original Message-----
From: Aaron Longwell [mailto:listservs@newmedialogic.com]
Sent: Friday, July 18, 2003 14:04
To: Struts-User
Subject: Action Under a Tile?

I am intermediately experienced with Struts, but I hit a brick wall
today trying to solve the following problem:

I am about 90% finished with a web app for a client. In discussions
yesterday they decided to add an "at-a-glance" section to each page of
the web site. You can think of this as a news feed that will sit on the
left sidebar, it will have the same information on every page, but
generating the information will require some business logic, and thus an
Action.

I can easily add the layout for this into the tile that services the
pages on the site.... It will be a simple collection to iterate over, so
the JSP is simple as well.

The Complicated Part: adding a collection to the request scope for each
of my existing actions. There are 15 actions existing.

I dreamed that it would be possible to add a tiles definition that
included the result of an Action as opposed to a JSP (well, more
accurately, included a JSP after being sent through an action first).
Essentially, this means 2 actions are executed on each request.... the
request's action... and the action to populate the data sidebar.

I tried to do this, by using a tag like this:
<tiles:put name="at-a-glance" value="/common/at-a-glance.do"/>

I get the following error: Exception in /common/at-a-glance.do Cannot
forward after response has been committed

I am intermediately experienced with servlets, and I know that servlet
includes are somewhat possible... but I'm obviously not experienced
enough to solve this problem. Thanks for your help!


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

  
Learn more about Paymentech's payment processing services at www.paymentech.com
THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and
confidential information intended only for the use of the recipient(s) named above.  If you
are not the intended recipient, you may not print, distribute, or copy this message or any
attachments.  If you have received this communication in error, please notify the sender by
return e-mail and delete this message and any attachments from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message