The code below produces the following output:
---------------------------------------
before ==
--------------------------------------
after ==

I would expect, however, to see
---------------------------------------
before ==
--------------------------------------
after == boo

Does anyone know what I am doing wrong?

********************************************
JSP code
******************************************
<%@ language="java" %>
<%@ import="beantest.*" %>
<html>
<head>
<title>This is another test</title>
</head>
<body>
<jsp:useBean id="bean1" scope="page" type="TestBean" class="TestBean" />

<hr>before ==
<jsp:getProperty name="bean1" property="UserId" />

<jsp:setProperty name="bean1" property="UserId" value="boo" />

<hr>after ==
<jsp:getProperty name="bean1" property="UserId" />

</body>
</html>

*****************************************
TestBean bean code
*****************************************
public class TestBean {
        private String fieldUserId = new String();

public TestBean() {
        super();
}

public String getUserId() {
        return fieldUserId;
}
public void setUserId(String userId) {
        fieldUserId = userId;
}
}

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to