• Post Reply Bookmark Topic Watch Topic
  • New Topic

passing object from JSP to servlet and vise versa

 
farhath farook
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ..
i want to pass object from JSP to servlet and vise versa..
but am bit confused about using using httprequset, httpresponse , which one to use and how to use it...
can anyone en light me in this area...
thanks in advance
[ November 25, 2008: Message edited by: Bear Bibeault ]
 
Vijitha Kumara
Bartender
Posts: 3952
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From servlet to JSP you can set the attributes in appropriate scope. If that matters only to the current request you can use HttpServletRequest/If that is relevant to a specific client you can use HttpSession to store those attributes. However you will have to pass the parameters necessary from JSP to servlet.
 
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
That greatly depends upon the relationship between the elements? How is the JSP related to the servlet? Forward? Redirect? Other? What about the JSp to the servlet? Form submission? Hyperlink?

The question cannot be answered without this information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!