• 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

Can't pass changed beans values from one JSP page to another

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Very new Java Beans student here with probably a very basic question. I've got a problem with passing changed bean values from a JSP page that displays a FORM to another JSP PAGE that simply displays the data. Here are the steps:
1. I get a list of job records from a database. The data for each record is saved in a bean called JobBean.
2. I select one record that is then displayed in a FORM in a JSP page:

3. I change some data in some of the fields.
4. I click submit - but the old data is sent to the employerEditJobResult.jsp JSP PAGE not the new data.

Obviously, I'm missing something. I thought that typing new values in the form would mean that those values would be passed onto the page, but not so. What am I missing?
Please be kind.
John
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's what you are missing:
<jsp:setProperty name="jobBean" property="*"/>
This reads all of the form elements and assigns them to the corresponding bean properties.
 
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
Welcome to the Ranch John New!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. And while your display name passes the format check, it fails on the 'obviously fictitious' front.
Please take a look at the JavaRanch Naming Policy and change your display name to match it.
Thanks!
bear
JSP Bartender
 
John New
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ron,
Many thanks, that is very helpful.
John
 
Bear Bibeault
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
Hey Little John, I'm pleased that you were able to have your question answered. And thanks for changing your display name, but the bad news is that 'Little John' still doesn't satisfy the Naming Policy requirements.
In order to keep this site a professional place where questions like yours can be answered, the Naming Policy requires your display name to at least look like a real name. I'm sure that you understand.
thanks,
bear
 
reply
    Bookmark Topic Watch Topic
  • New Topic