<jsp:useBean> and session.getAttribute()
843835Feb 20 2003 — edited Feb 21 2003Hi,
I got a very interesting question about jsp:useBean and session.getAttribute().
In my servlet, I put one servlet (student) in session like this:
Request.getsession().setAttribute("com.abc.Student", student)
In the JSP page, if I use session.getAttribute() like this:
Student stu=(Student)session.getAttribute("com.abc.Student");
It works.
But if I use jsp:useBean
Like this:
<% page session="true" %>
<jsp:useBean id="stu" class="com.abc.Student" scope="session" ></jsp:useBean>
I cannot get the content in Student. Everything in Student is null.
Can you give me some idea?
Thank you.
John