Meaningless Drivel is fun!*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
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: 61413
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transfering data from client to the Server via Bean