The value of the 'name' attribute on the <jsp:getProperty> tag cannot be a
runtime expression, per the JSP spec. See the section entitled "Request Time
Attribute Values" for the details.

--
Martin Cooper


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 21, 2001 1:49 PM
Subject: run time expressions & <jsp:xxx> attributes


>
> Hi, the struts example mainMenu.jsp page accesses the User bean like so:
> ...
> <jsp:useBean id="user" scope="session" type
> ="org.apache.struts.webapp.example.User"/>
> ...
> <jsp:getProperty name="user" property="username"/>
>
>
> However, the bean is set in LogonAction like so:
>
> session.setAttribute(Constants.USER_KEY, user);
>
>
> Is it possible to use a run time expression instead?
>
> <%@ page import="org.apache.struts.webapp.example.Constants"%>
>
> <jsp:getProperty name="<%=Constants.USERBEAN%>" property="username"/>
>
>
>
> I am not able to do so, I get a org.apache.jasper.JasperException:
> Attempted a bean operation on a null object.
>
>
> Is it possible to do this?
>
>


Reply via email to