• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing object from JSP to servlet or another JSP page

 
samart mateo
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will not work because javascript is client side scripting language. You can not set session variable in javascript
 
samart mateo
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, realised that already..thank you.
But, can anybody advise me how to send object to another page?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!