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!

Accessing a session bean variable and passing it to a String variable

843840Jul 31 2008 — edited Aug 13 2008
How do i pass a session bean variable using the useBean method to a String variable in a JSP page to use?

Action form bean:

request.getSession().setAttribute("member",test); // setting the session bean

JSP process page:

<jsp:useBean id="member" class="com.myapp.structs.Member" scope="session"></jsp:useBean>

<% String a = member.getName(); %>

The problem is that the method i use here access the "Member" bean but not the session bean set and thats why it returns a null value. i know the session Bean is setting as i use {$member.name} to output the details on a JSP page.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2008
Added on Jul 31 2008
29 comments
1,307 views