Hi,

On 9/10/05, Tony Smith <[EMAIL PROTECTED]> wrote:
> 
> I have an attribute saved in session. In servlet, I
> can access it by
> request.getSession().getAttribute("my");
> 
> In jsp, how can I access it without write java code? I
> am thinking about <bean:page>, but do not know how to
> use it.
> 
> Thanks,


I presume you want to display a property of the bean:
Using JSTL:
<c:out value="{session.my.property}" />

or if you are sure that an attribue with the same name (my) is not set in 
page and request scope:
<c:out value="{my.property}" />

JSP standard tags:

<jsp:useBean id="my" class="your.package.YourBeanClass" scope="session" />
<jsp:getProperty name="my" property="property" />

Struts tags:

<bean name="my" property="property" scope="session" />


Tamas

Reply via email to