Hello friends
I am using
Tomcat 5.
In
servlet I wrote the following code
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
{
foo.mybean mb=new foo.mybean();
mb.setName("Universe");
foo.mybean mb1=new foo.mybean();
mb1.setName("World");
request.setAttribute("obj",mb1);
request.getSession().setAttribute("obj",mb);
request.getRequestDispatcher("/useBean.jsp").forward(request,response);
return;
}
Now in useBean.jsp I wrote the following code
<
jsp:useBean id="obj" class="foo.mybean" scope="session"/>
<jsp:getProperty name="obj" property="name"/>
In foo.myBean I have just a getter and setter method for setting and getting the name..
Now I was expecting to get the output "Universe" but was shocked to see that I was getting "World" as output despite of me setting the scope to "session" in <jsp:useBean> tag !!
Is this a bug in Tomcat 5 or I am misunderstood ?
Please help me ..
Waiting for your replies..
Thanks and Regards
Rohit