This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transferring value from jsp page to Transfer Object

 
Kaushik Baral
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Can anyone suggest me how to transfer some value from jsp page to any java bean.
my requirement is i want to enter some values in a jsp page and after submitting this page values will be stored in the bean. i have a servlet also. so where i have to handle the values ? i dont want to use "request.getParameter()" also. so is there any way to store the values ??

Thanks a lot in advance.
 
Piyush Mangal
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either you do it yourself or let frameworks like Struts, Spring MVC do it for you. Eventually request.getParameter() is called to get submitted values from HTML/JSP pages.
So if you don't want to do it yourself, look for web framework like struts and SpringMVC which will make your life easier.
 
Kaushik Baral
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Piyush,

Thanks for your suggestion but unfortunately i am not using any framework. its a jsp/servlet based application. so how i have to do it in this scenario? yes i have to handle it manually. can someone suggest how to do it?

thanks a lot in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't "transfer a value" from a JSP page. A JSP is simply a template from which an HTML page is created and sent to the browser. Data is then submitted from the HTML page back to the server. On the server this data is read with the getParameter() family of methods.

If you do not understand what JSP is, I suggest this article.
 
Piyush Mangal
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately you have no option but to use request.getParameter() method.
You can have something like below



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic