• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
John New
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Ron,
Many thanks, that is very helpful.
John
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic