• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transfering data from client to the Server via Bean

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic