aspose file tools
The moose likes JSP and the fly likes Passing object from JSP to servlet or another JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Passing object from JSP to servlet or another JSP page" Watch "Passing object from JSP to servlet or another JSP page" New topic
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
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
    
  13

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing object from JSP to servlet or another JSP page
 
Similar Threads
How to perform operations like insert,delete,add,move next etc in jsp page?
Session expires ,user session expires when online
servlet mapping
Accessing a beanList Returned from JSP
DispatchAction coding problem ~~mod pls check this thread, display problem,tq