aspose file tools
The moose likes Servlets and the fly likes Transfering data from client to the Server via Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Transfering data from client to the Server via Bean" Watch "Transfering data from client to the Server via Bean" New topic
Author

Transfering data from client to the Server via Bean

John Lincoln
Ranch Hand

Joined: Feb 11, 2003
Posts: 192
Hi,

I have form, which takes some input from the user and submits to the servelt.

If i have bean associated with form values, how do i set these values in the bean and how do i retrieve them on the server-side ?

I created a bean, mybean



but when i retrieve request.getAttribute("mybeanvalue"); on the server side i get null value.

Do iam missing some thing here

please help

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

Originally posted by John Lincoln:
Do iam missing some thing here


I don't know what "do iam" means, but the thing that you are missing is that any code on a JSP page gets executed on the server in order to render the HTML page to send to the browser.

Therefore, your bean, and all the code on the page to set it up, executes before the form is even sent to the browser.

You shouldn't be doing anything on the JSP page to try and capture form input. That's the job of the servlet that you are submitting to. The role of the JSP is just to format the form to send to the browser.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transfering data from client to the Server via Bean
 
Similar Threads
Pass form object to JSP
Transfer data from Java beans to portlet
reagarding jsp problem
How to get pair values using getParameterNames?
saving the details in when i click next and previous buttons