You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Latham <al...@kanbay.com> on 2003/03/10 03:02:25 UTC

Passing a Collection object from 1 JSP to another without scoping it to session

Hope someone has had success with this.

Basically using Struts the results of a query are returned to a JSP page
and accessible via the "request" object with something like:
<%java.util.Collection requestCollection = (java.util.Collection)
request.getAttribute("classificationlist"); %>

I'm trying to pass this to another JSP page. I've tried:
<%request.setAttribute("classificationlist", requestCollection); %>

Which doesn't error but its value is NULL on the next JSP. All doco and
other discussion forums suggest this method, but what I'm finding is
this will only work if I use the <jsp:forward> or <jsp:include>. Is
there a way to pass this to a page which is access by a <a
href="nextpage.jsp">Next</a>? I currently do this by rescoping to
session but the problem with this is it hangs around until I log out.

Any suggestions/help appreciated.

Andrew Latham




*----------
This message and any attachment(s) is intended only for the use of the addressee(s) and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended addressee(s), you are hereby notified that any use, distribution, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please erase all copies of the message and its attachment(s) and notify the sender or Kanbay postmaster immediately.

Any views expressed in this message are those of the individual sender and not of Kanbay.

Although we have taken steps to ensure that this e-mail and any attachment(s) are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free.


Re: Passing a Collection object from 1 JSP to another without scoping it to session

Posted by Eric Larson <er...@teaminteract.com>.
I think that you will find the answer to this to be no. The scope of a
request object is the servlet service method, so if you are processing a
different request, you are automatically going to have a different
request object.


On Sun, 2003-03-09 at 21:02, Andrew Latham wrote:
> Hope someone has had success with this.
> 
> Basically using Struts the results of a query are returned to a JSP page
> and accessible via the "request" object with something like:
> <%java.util.Collection requestCollection = (java.util.Collection)
> request.getAttribute("classificationlist"); %>
> 
> I'm trying to pass this to another JSP page. I've tried:
> <%request.setAttribute("classificationlist", requestCollection); %>
> 
> Which doesn't error but its value is NULL on the next JSP. All doco and
> other discussion forums suggest this method, but what I'm finding is
> this will only work if I use the <jsp:forward> or <jsp:include>. Is
> there a way to pass this to a page which is access by a <a
> href="nextpage.jsp">Next</a>? I currently do this by rescoping to



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