aspose file tools*
The moose likes Servlets and the fly likes passing objects from servlet to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "passing objects from servlet to jsp" Watch "passing objects from servlet to jsp" New topic
Author

passing objects from servlet to jsp

kirtesh jain
Ranch Hand

Joined: Nov 15, 2008
Posts: 44
hi... i hav one class which contains almost 10 vectors of different types...
and to display i hav to transfer that object to jsp page so please tell me what is the best way to transfer the object with example code please help me out...
thank you...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

How are you transitioning from the servlet to the JSP? A forward?

If so, simply create a request-scoped variable. You can then use the EL on the JSP to access the variable.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

Helpful hint: in English, sentences are terminated with a period, not an ellipsis. This will help make your posts more readable.
kirtesh jain
Ranch Hand

Joined: Nov 15, 2008
Posts: 44
If so, simply create a request-scoped variable. You can then use the EL on the JSP to access the variable

hi .
thanks for reply.
Please can you tell me something more about request-scoped variable and EL in JSP to Access variable using a sample code for example my class name is DataHolder and the object i hav is DH..Please show me using example since i am new to Servlet and JSP
Thank You.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
transfer that object to jsp page


[teaching-mode]Using the wrong words promotes sloppy thinking. You do not "transfer" objects, you transfer references to objects. The actual objects stay put and there may be many references to the same object in many different places. [/teaching-mode]

Bill
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
Please can you tell me something more about request-scoped variable and EL in JSP to Access variable

Maybe you would like to visit here


Thanks and Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing objects from servlet to jsp