Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

<jsp:useBean> and session.getAttribute()

843835Feb 20 2003 — edited Feb 21 2003
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2003
Added on Feb 20 2003
6 comments
360 views