wood burning stoves 2.0*
The moose likes JSP and the fly likes Transferring value from jsp page to Transfer Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Transferring value from jsp page to Transfer Object" Watch "Transferring value from jsp page to Transfer Object" New topic
Author

Transferring value from jsp page to Transfer Object

Kaushik Baral
Greenhorn

Joined: Aug 08, 2009
Posts: 23
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

Joined: Jan 22, 2007
Posts: 196
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
Greenhorn

Joined: Aug 08, 2009
Posts: 23
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

Joined: Jan 10, 2002
Posts: 60741
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
Unfortunately you have no option but to use request.getParameter() method.
You can have something like below



 
wood burning stoves
 
subject: Transferring value from jsp page to Transfer Object
 
Similar Threads
Getting html form name
setting value of bean on jsp using spring tag library
Passing values from Javascript to JSP application
Problem in setting a value of drop down
Adding new values in Session