You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chip Paul <pr...@yahoo.com> on 2002/08/25 23:08:00 UTC

Mapping troubles with a dynamically generated template include

My site features a "news" sidebar that is present on
every page.  It is pulled from a database.

My files use the templates and set "news.jsp" as a
content spot.

<template:insert template='template.jsp'>
	<template:put name='news' content='news.jsp' />
</template:insert>

My question is: How can I have my NewsAction called
and the results populated into the news.jsp file, and
all this work in a templated mode so it appears on
every page.

I tried using /news.do as the template, but that
causes an exception when the forward gets processed
after the JSPWriter has begun writing.  I remapped
news.jsp in my struts config to auto-call the action
and forward to a different jsp file, but I still get
the exception:

java.lang.IllegalStateException: Cannot forward after
response has been committed

I'm sure this has been done since it's common in
"Blogger" type apps, but I can't find a reference to
how to do it correctly.

Thanks,

Chip

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Mapping troubles with a dynamically generated template include

Posted by Cedric Dumoulin <ce...@apache.org>.
  Hi,

  Check Tiles. They are compatible with templates, and accept an action 
has content. Also, you can associate a "controller" to a tile. This 
controller will populate your tile.

  Hope this help,
         Cedric

Chip Paul wrote:

>My site features a "news" sidebar that is present on
>every page.  It is pulled from a database.
>
>My files use the templates and set "news.jsp" as a
>content spot.
>
><template:insert template='template.jsp'>
>	<template:put name='news' content='news.jsp' />
></template:insert>
>
>My question is: How can I have my NewsAction called
>and the results populated into the news.jsp file, and
>all this work in a templated mode so it appears on
>every page.
>
>I tried using /news.do as the template, but that
>causes an exception when the forward gets processed
>after the JSPWriter has begun writing.  I remapped
>news.jsp in my struts config to auto-call the action
>and forward to a different jsp file, but I still get
>the exception:
>
>java.lang.IllegalStateException: Cannot forward after
>response has been committed
>
>I'm sure this has been done since it's common in
>"Blogger" type apps, but I can't find a reference to
>how to do it correctly.
>
>Thanks,
>
>Chip
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Finance - Get real-time stock quotes
>http://finance.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>