Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

passing object from JSP to servlet and vise versa  RSS feed

 
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 ]
 
Saloon Keeper
Posts: 4041
47
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.
 
Author and ninkuma
Marshal
Posts: 66478
160
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!