Author
Passing object from JSP to servlet or another JSP page
samart mateo
Ranch Hand
Joined: Feb 06, 2006
Posts: 37
Hello everyone, can anybody tell me how to pass an object to another servlet or JSP page? I have a list of groups such as: CTRM Aero Composites -- Finance -- Program B1 -- Program B2 -- Strategic Development ---- Operation Analysis CTRM AU -- Finance Each of these groups are actually a link that could open up another page, sending with it the object of each group. I tried doing this: but the session.setAttribute was not initiated upon on click action. Can someone assist me on this? Thank you.
Shahnawaz Shakil
Ranch Hand
Joined: Aug 04, 2008
Posts: 57
posted Aug 07, 2008 03:59:00
0
This will not work because javascript is client side scripting language. You can not set session variable in javascript
samart mateo
Ranch Hand
Joined: Feb 06, 2006
Posts: 37
Yes, realised that already..thank you. But, can anybody advise me how to send object to another page?
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
You'll need to give us some relevant information about the nature of the object. Generally, scoped variables (set via setAttribute() methods) are used. Request scope is used to "pass" information to resources in the same request, while session scope is used to extend the life of the variable beyond a single request.
[Smart Questions ] [JSP FAQ ] [Books by Bear ] [Bear's FrontMan ] [About Bear ]
subject: Passing object from JSP to servlet or another JSP page