struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas De Loof" <nicolas.del...@cgey.com>
Subject Re: <bean:define> question
Date Tue, 25 Jun 2002 14:27:01 GMT

only "id" is required.

"id" set the name of the scripting variable AND context objet that tag will
define for you.

"toScope" set the scope to define the context object (PAGE by default)

If you specify "name" and/or "property", bean:define will look for this
object/property in "scope" (or in all scopes if not specified) for the value
of the object to be define.

If you specify a "value", tag will use it for the value of the object to be
define.

=> so name/property and value should not be used together !

"type" sets the java type of the scripting variable to be set
(java.lang.Object if omitted)



So, you can use :

<bean:define id="crs" value="My heebyjeeby string" type="java.lang.String"/>
<!-- a "crs" object is defined in page scope + a String script variable -->

<bean:write name="crs"/>
<!-- or the scriptlet way : -->
<%= crs %>


Nico


> Subject: <bean:define> question
> From: "David Chu" <davidchu@aol.net>
>  ===
> I am confused by the documentation concerning <bean:define>.
Specifically,
> I must write:
>
> <bean:define id="crs" name="crs" value="My heebyjeeby string" scope="page"
> />
> <bean:write name="crs" scope="page" />
>
> In order to print out "My heebyjeeby string."  I don't understand the
> purpose of the "id" property and the "name"  property.  Why are both
needed
> and what purpose does one serve that the other does not?
>
> -david



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message