This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 67752
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: 67752
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
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic