Hi,

My app has a logon class that stores a  User bean with logon information in
session scope  like so:

session.setAttribute(Constants.USER_KEY, user);     // Constants.USER_KEY =
"user"

I can access *all* of the properties of this bean from a jsp if I use
scriptlets:

<% User user2 = (User) session.getAttribute("user"); %>
 <%= user2.getUserId() %>
<%= user2.getUSystem() %>
// etc...

If I attempt to retrieve only the *first* property (userId) from the bean, I
can also use the jsp: tag syntax:

<jsp:useBean id="user" type="myPackage.User" class="myPackage.User"
scope="session" />
<jsp:getProperty name="user" property="userId" />

But if I try and retrieve any other property, for example:

<jsp:useBean id="user" type="myPackage.User" class="myPackage.User"
scope="session" />
<jsp:getProperty name="user" property="userId" />
<jsp:getProperty name="user" property="uSystem" />  // another property

I get a jsp compiler error complaining that he can't find the other property
on the bean!?

Has anyone else encountered this?  Why would one syntax work for everything,
and the other only work for one property?  There is another bean on the page
that I use the tag syntax for, and I can get to all of its properties with
no problem.  Any suggestions?

Thanks...

George Phillips
University of Miami Information Technology
1365 Memorial Drive Rm. 202-H
Coral Gables, FL  33146
Phone: 305-284-5143
Email:  [EMAIL PROTECTED]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to