Employee is a simple bean, with name attribute and getter / setter
This is the code in my
servlet:
Employee p = new Employee();
p.setName("Evan");
req.setAttribute("person",p);
// forward to a
jsp This is my code in the jsp:
<jsp:useBean id="person" type="other.Employee" >
<jsp:setProperty name="person" property="name" value="Fred"/> </jsp:useBean> Name is : <jsp:getProperty name="person" property = "name"/>
According to me and HFJS, this code should work. But somehow it is not working.. Could you tell me why ?
Also,
If I change the jsp tag "usebean" to <jsp:useBean id="person" type="other.Employee"
scope="request">
Then the code works fine. I am not able to understand why is this so..
For reference HFJS page no. : 356 has this problem mentioned.