This may be a bit of an overshare, but I'm trying to figure out what
I'm doing wrong here.  I'm learning about HTML, JSPs, and working with
the GAE.

For starters, I have the following HTML page where the user enter's
the employees first name.
This posts to the JSP below
<html>
        <body>
                <FORM METHOD=POST ACTION="EmployeeRegistration.jsp">
                        <table>
                                <tr>
                                        <td>First Name</td><td><input 
type="text" name="firstName"></td>
                                </tr>
                        </table>
                        <input type="submit">
                </FORM>
        </body>
</html>

As I understand it, the post to this page will populate the firstName
property of the employee bean indicated in the JSP below
<jsp:useBean id="employee" class="com.alex.Employee" scope="session"/>
<jsp:setProperty property="*" name="employee"/>
<html>
        <body>
                <a href="EmployeeRegistrationConfirmation.jsp">Continue</a>
        </body>
</html>

so, the JSP should call the setFirstName method of the Employee class
on the post to the above JSP
package com.alex;
public class Employee {
        private String firstName;

        public String getFirstName() {
                return firstName;
        }
        public void setFirstName(String firstName) {
                this.firstName = firstName;
        }
}

So, why doesn't the following produce the right results?:
<jsp:useBean id="employee" class="com.benniefinder.Employee"
scope="session"/>
<html>
        <body>
                Your name is <jsp:getProperty property="firstName" 
name="employee"/>
<br/>
                Your name is <% employee.getFirstName(); %>
        </body>
</html>

The first of the two lines above outputs the firstName property of the
bean, but the second line outputs an empty string.

What am I missing?

Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to