I cannot get person.name.lastName or person.name.firstName to display
in the table.  I have combed the group and looked at many posts but
for the life of me I cannot tell what the problem is.

I started by copying HelloWeb

resides in package org.apache.taglibs.standard.examples.beans;
Person Class
public class Person {
    private Name name;
    public Person(String firstName, String lastName) {
        Name name = new Name();
        name.setFirstname(firstName);
        name.setLastname(lastName);
    }
    public Name getName() {
        return name;
    }
    public void setName(Name name) {
        this.name = name;
    }
}

Name Class
public class Name {
    private String firstName;
    private String lastName;
    public Name() {
    }
    public Name(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }
    public String getFirstname() {
        return firstName;
    }
    public void setFirstname(String firstName) {
        this.firstName = firstName;
    }
    public String getLastname() {
        return lastName;
    }
    public void setLastname(String lastName) {
        this.lastName = lastName;
    }
}

Init
// Person
        Person p1 = new Person("Chris", "Kellawan");
        sce.getServletContext().setAttribute("person", p1);

response.jsp
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>response.jsp Page</h1>
        <jsp:useBean id="mybean" scope="application"
class="org.me.hello.NameHandler" />
        <jsp:setProperty name="mybean" property="*"  />
        Hello, <jsp:getProperty name="mybean" property="name" />
        <br>
        <br>
        <%-- Exercise Expression Language  --%>
        <table border="1">
                <tr>
                    <td><c:out value="${person.name.getFirstName}"/></
td>
                    <td><c:out value="${person.name.getLastName}"/></
td>
               </tr>
        </table>
    </body>
</html>


Any help would be greatly appreciated.

Thanks

Chris Kellawan

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to