struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Riley" <kri...@allconnect.com>
Subject RE: [TILES] Problem using struts actions in tile's template
Date Wed, 23 Oct 2002 23:21:44 GMT
Thanks Cedric, Danny, James for all of your help. I understand what you are
saying (re:forwards/includes). 

As a test I modified the struts 1.02 ActionServlet
(I love OSS:-)) to check response.isCommitted() and do a forward or include
accordingly. This works great in Tomcat. Unfortunately it does not work in 
WL6.1 SP3.  The WL response object seems to always isCommitted==false so I never do
an include and it never works :-/.  

Oh well, I guess I'll have to do the thing I was dreading most, re-writing 
the whole site templating. Ugh.

Thanks again for the quick and knowledgeable response!!

Ken

-----Original Message-----
From: Cedric Dumoulin [mailto:cedric@apache.org]
Sent: Wednesday, October 23, 2002 11:50 AM
To: Struts Users Mailing List
Subject: Re: [TILES] Problem using struts actions in tile's template



  Hi,

  Danny has well explained what is happening. The problem is that Struts 
RequestProcessor do a forward in response to the <forward> in the config 
file. If you use the Tiles servlet, your code should work because the 
TilesRequestProcessor check if the response has already been committed. 
If yes, TilesRequestProcessor do an include instead of a forward.

  To be short, use the TilesRequestProcessor, and it should work ;-).

   Cedric

Trieu, Danny wrote:

>Think of the template.jsp is the servlet that currently running, and
>rendering text in response to the broser.  Your other section on the
>template.jsp, the content and the header, do a dynamic include which in
>result as a forward to the intented jsp.  We all know that once the server
>start writing to the response stream, any attemp to forward control to other
>servlet will result with exception telling 
>You that you can't do this.  
>
>Instead of wanting action class to something before the template attempted
>to include the targeted jsp
>You can use Tiles' controller class or action controller to do it.
>
>Hope this would help
>
>danny
>
>-----Original Message-----
>From: Ken Riley [mailto:kriley@allconnect.com] 
>Sent: Tuesday, October 22, 2002 2:19 PM
>To: Struts Users Mailing List
>Subject: [TILES] Problem using struts actions in tile's template
>
>
>I'm probably being dense here (not an uncommon occurance) but I seem to be
>unable to 
>create a tile layout that uses multiple actions. I have a sample below that
>I'm using to 
>test. When I run this, I don't get any output for the header.do action call.
>Ultimately I would like to have a layout that calls 4 or 5 actions but I'd
>like to get my test app working first :).
>
**** Omitted for brevity ******

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


Mime
View raw message