Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing objects from servlet to jsp

 
kirtesh jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic