| Author |
Can't pass changed beans values from one JSP page to another
|
John New
Greenhorn
Joined: Sep 04, 2003
Posts: 2
|
|
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
Joined: Jun 06, 2002
Posts: 1056
|
|
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.
|
Ron Newman - SCJP 1.2 (100%, 7 August 2002)
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
|
|
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
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
John New
Greenhorn
Joined: Sep 04, 2003
Posts: 2
|
|
Ron, Many thanks, that is very helpful. John
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
|
|
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
|
 |
 |
|
|
subject: Can't pass changed beans values from one JSP page to another
|
|
|