Passing dynamic object from a JSP page to another JSP page
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   claudia_mary
Posted On:   Sunday, August 15, 2004 09:30 PM


Hi

As a part of my coding i obtain a dynamically generated String of array objects in a JSP page and now i want to pass this object to another JSP page on Submit. How can i achieve this?.

thanks

claudia

Re: Passing dynamic object from a JSP page to another JSP page

Posted By:   John_Hathaway  
Posted On:   Wednesday, August 25, 2004 01:35 PM


Store the object as a request attribute (request scope):

<% request.setAttribute("object-name", object); %>


In the target page, retrieve the object from the request:

<% Object object = request.getAttribute("object-name"); %>

Re: Passing dynamic object from a JSP page to another JSP page

Posted By:   shashidhar_bodla  
Posted On:   Monday, August 16, 2004 05:05 AM

Hi claudia,

This is so simple, all you need to do is,

once the object is constructed dynamically, then the first page where it is constructed, you need to serialize the object and then keep in the session. as the generated object is in your session, it is available all the way.
the next page where ever you want that object, you need to
unserialize the object and proceed further.


cool................

enjoy..

bye for now().

Re: Passing dynamic object from a JSP page to another JSP page

Posted By:   Sergey_Didenko  
Posted On:   Monday, August 16, 2004 04:23 AM

Hi,

Not sure what you mean by 'dynamically generated String of array objects', but how about just creating a bean object with the session scope. You submit your page to itslef, pass the generated parameter into your bean and then invoke



response.sendRedirect("[your_second_page.jsp]");
return;




On your second page you include the same bean and here we go. Or did I misunderstand your problem?



Sergey Didenko, Palmosters Development Team, http://www.palmosters.com

Re: Passing dynamic object from a JSP page to another JSP page

Posted By:   Sergey_Didenko  
Posted On:   Monday, August 16, 2004 04:23 AM

Hi,

Not sure what you mean by 'dynamically generated String of array objects', but how about just creating a bean object with the session scope. You submit your page to itslef, pass the generated parameter into your bean and then invoke



response.sendRedirect("[your_second_page.jsp]");
return;




On your second page you include the same bean and here we go. Or did I misunderstand your problem?



Sergey Didenko, Palmosters Development Team, http://www.palmosters.com
About | Sitemap | Contact