You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Aaron Longwell <li...@newmedialogic.com> on 2003/07/18 20:04:10 UTC

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


Re: Action Under a Tile?

Posted by Aaron Longwell <li...@newmedialogic.com>.
KC,

I tried your setup, and I double-checked to make sure my forward said 
redirect="false". I am still getting the same error: Cannot forward 
after response has been committed.

Are you sure that's a legal process?

Here's the top of the stack trace:
2003-07-18 12:33:42 ApplicationDispatcher[] Servlet.service() for 
servlet StrutsAction threw exception
java.lang.IllegalStateException: Cannot forward after response has been 
committed
    at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:368)
    at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
    at 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    at 
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
    at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
    at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

Thanks,
Aaron

K.C. Baltz wrote:

> I suspect the problem is somehow specific to your at-a-glance 
> action.   Is it possible that it's trying to redirect?
>
> I know that it's possible to do:
>
> <tiles:insert page="/someaction.do" />
>
> which is basically what you're trying to do I assume.
>
> K.C.
>
> Aaron Longwell wrote:
>
>> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>


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


Re: Action Under a Tile?

Posted by "K.C. Baltz" <kc...@lollimail.com>.
I suspect the problem is somehow specific to your at-a-glance action.   
Is it possible that it's trying to redirect?

I know that it's possible to do:

<tiles:insert page="/someaction.do" />

which is basically what you're trying to do I assume.

K.C.

Aaron Longwell wrote:

> 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
>


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


RE: Action Under a Tile?

Posted by Mike Jasnowski <mj...@bea.com>.
We have a tile definition that does something similar, it includes a JSP
with an import of another JSP on it
The JSP the tile points to has this code on it

<c:import url="/url"/>

Additionally the url is parameterized via tiles controller, so the actual
tag usage looks like this:

<c:import url="${view.form}"/>



Which includes the contents there.

Not sure if this will solve your problem.

-----Original Message-----
From: Aaron Longwell [mailto:listservs@newmedialogic.com]
Sent: Friday, July 18, 2003 2:04 PM
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



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