struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: bean: access to the session
Date Tue, 20 Mar 2001 20:50:14 GMT


On Fri, 4 Jan 1980, hunkpapa wrote:

> Hi,
> I've a problem with beans.
> I can use a bean with the writeTag and this works out well.
> 
> But how can this bean access the session ?
> I want to read values I placed in the session
> to use them in the getter methods of the bean.
> 
> 
> 

If the bean itself is a String you want to write:

	<bean:write name="beanName" scope="session"/>

If the bean is an object whose property you want to write:

	<bean:write name="customer" property="companyName"
		scope="session"/>

In general, most Struts tags that accept a "name" attribute also let you
specify a "scope" attribute.

Craig McClanahan



Mime
View raw message