You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by slideharmony <se...@tiscali.it> on 2007/11/15 17:28:08 UTC

access to bean property in struts2

Hello,
how can I access a bean properties from a jsp page?
I have created an action to creare a new account for a generic user, and I
want to print in a jsp page the full name of the new user. Usually I put the
new User object in session and obtained his properties by this way form the
jsp page, but probably there is some other way with strut2.
thank you
-- 
View this message in context: http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#a13774814
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: access to bean property in struts2

Posted by "Hernandez, David" <da...@lehman.com>.
In your action:
class Whatever extends ActionSupport{
	User user;
	public User getUser(){return User;}
	public String execute(){//set User}
}
In jsp:
<s:property value="user.memberVariable" />

-----Original Message-----
From: slideharmony [mailto:setoiori@tiscali.it] 
Sent: Friday, November 16, 2007 10:53 AM
To: user@struts.apache.org
Subject: Re: access to bean property in struts2


I have another question:
it is right in struts2 to put beans in session? Assuming to have an
action that retrieve a bean User from the database; the user have a set
of contracts. I want to iterate this set in a jsp page, which ways have
I to do that? I have to put the bean User in session, or is there
something else i can do? maybe using the value stack?



Thilo Ettelt wrote:
> 
> You can expose a property or bean to the JSP Expression language
> (${myPropertyOrBean}) by using s:set taglib.
> 
> 
> - Thilo
> 
> slideharmony wrote:
>> ok, but I read somewhere that I can do that without setting a 
>> property User in my action, using the action stack, or something like

>> this, I believed that last action I have used should be available, or

>> not?
>>
>>
>>
>>
>> Hernandez, David wrote:
>>   
>>> Set the Bean as a member of the Action class and use:
>>> <s:property value="beanVarName.beanMemberName" />
>>>
>>> -----Original Message-----
>>> From: slideharmony [mailto:setoiori@tiscali.it]
>>> Sent: Thursday, November 15, 2007 11:28 AM
>>> To: user@struts.apache.org
>>> Subject: access to bean property in struts2
>>>
>>>
>>> Hello,
>>> how can I access a bean properties from a jsp page?
>>> I have created an action to creare a new account for a generic user,

>>> and I want to print in a jsp page the full name of the new user. 
>>> Usually I put the new User object in session and obtained his 
>>> properties by this way form the jsp page, but probably there is some
other way with strut2.
>>> thank you
>>> --
>>> View this message in context:
>>> http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.h
>>> tml#
>>> a13774814
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
>>> - -
>>> -
>>> - - - - - - -
>>>
>>> This message is intended only for the personal and confidential use 
>>> of the designated recipient(s) named above.  If you are not the 
>>> intended recipient of this message you are hereby notified that any 
>>> review, dissemination, distribution or copying of this message is 
>>> strictly prohibited.  This communication is for information purposes

>>> only and should not be regarded as an offer to sell or as a 
>>> solicitation of an offer to buy any financial product, an official 
>>> confirmation of any transaction, or as an official statement of 
>>> Lehman Brothers.  Email transmission cannot be guaranteed to be 
>>> secure or error-free.
>>> Therefore,
>>> we do not represent that this information is complete or accurate 
>>> and it should not be relied upon as such.  All information is 
>>> subject to change without notice.
>>>
>>> --------
>>> IRS Circular 230 Disclosure:
>>> Please be advised that any discussion of U.S. tax matters contained 
>>> within this communication (including any attachments) is not 
>>> intended or written to be used and cannot be used for the purpose of

>>> (i) avoiding U.S. tax related penalties or (ii) promoting, marketing

>>> or recommending to another party any transaction or matter addressed

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

--
View this message in context:
http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#
a13795735
Sent from the Struts - User mailing list archive at Nabble.com.


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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.

--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.



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


RE: access to bean property in struts2

Posted by Dave Newton <ne...@yahoo.com>.
<s:iterator...>, but otherwise correct ;)

--- "Hernandez, David" <da...@lehman.com>
wrote:

> 
> Sorry, if you want to iterate through the contracts,
> let's say they're
> members of User (name contracts) in jsp:
> <s:iterate value="user.contracts">
> 	<s:property value="someMemberOfContracts" />
> </s:iterate>
> 
> -----Original Message-----
> From: slideharmony [mailto:setoiori@tiscali.it] 
> Sent: Friday, November 16, 2007 10:53 AM
> To: user@struts.apache.org
> Subject: Re: access to bean property in struts2
> 
> 
> I have another question:
> it is right in struts2 to put beans in session?
> Assuming to have an
> action that retrieve a bean User from the database;
> the user have a set
> of contracts. I want to iterate this set in a jsp
> page, which ways have
> I to do that? I have to put the bean User in
> session, or is there
> something else i can do? maybe using the value
> stack?
> 
> 
> 
> Thilo Ettelt wrote:
> > 
> > You can expose a property or bean to the JSP
> Expression language
> > (${myPropertyOrBean}) by using s:set taglib.
> > 
> > 
> > - Thilo
> > 
> > slideharmony wrote:
> >> ok, but I read somewhere that I can do that
> without setting a 
> >> property User in my action, using the action
> stack, or something like
> 
> >> this, I believed that last action I have used
> should be available, or
> 
> >> not?
> >>
> >>
> >>
> >>
> >> Hernandez, David wrote:
> >>   
> >>> Set the Bean as a member of the Action class and
> use:
> >>> <s:property value="beanVarName.beanMemberName"
> />
> >>>
> >>> -----Original Message-----
> >>> From: slideharmony [mailto:setoiori@tiscali.it]
> >>> Sent: Thursday, November 15, 2007 11:28 AM
> >>> To: user@struts.apache.org
> >>> Subject: access to bean property in struts2
> >>>
> >>>
> >>> Hello,
> >>> how can I access a bean properties from a jsp
> page?
> >>> I have created an action to creare a new account
> for a generic user,
> 
> >>> and I want to print in a jsp page the full name
> of the new user. 
> >>> Usually I put the new User object in session and
> obtained his 
> >>> properties by this way form the jsp page, but
> probably there is some
> other way with strut2.
> >>> thank you
> >>> --
> >>> View this message in context:
> >>>
>
http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.h
> >>> tml#
> >>> a13774814
> >>> Sent from the Struts - User mailing list archive
> at Nabble.com.
> >>>
> >>>
> >>>
>
--------------------------------------------------------------------
> >>> - To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail:
> user-help@struts.apache.org
> >>>
> >>> - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - 
> >>> - -
> >>> -
> >>> - - - - - - -
> >>>
> >>> This message is intended only for the personal
> and confidential use 
> >>> of the designated recipient(s) named above.  If
> you are not the 
> >>> intended recipient of this message you are
> hereby notified that any 
> >>> review, dissemination, distribution or copying
> of this message is 
> >>> strictly prohibited.  This communication is for
> information purposes
> 
> >>> only and should not be regarded as an offer to
> sell or as a 
> >>> solicitation of an offer to buy any financial
> product, an official 
> >>> confirmation of any transaction, or as an
> official statement of 
> >>> Lehman Brothers.  Email transmission cannot be
> guaranteed to be 
> >>> secure or error-free.
> >>> Therefore,
> >>> we do not represent that this information is
> complete or accurate 
> >>> and it should not be relied upon as such.  All
> information is 
> >>> subject to change without notice.
> >>>
> >>> --------
> >>> IRS Circular 230 Disclosure:
> >>> Please be advised that any discussion of U.S.
> tax matters contained 
> >>> within this communication (including any
> attachments) is not 
> >>> intended or written to be used and cannot be
> used for the purpose of
> 
> >>> (i) avoiding U.S. tax related penalties or (ii)
> promoting, marketing
> 
> >>> or recommending to another party any transaction
> or matter addressed
> 
> >>> herein.
> >>>
> >>>
> >>>
> >>>
>
--------------------------------------------------------------------
> >>> - To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail:
> user-help@struts.apache.org
> >>>
> >>>
> >>>
> >>>     
> >>
> >>   
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> > 
> 
> --
> View this message in context:
>
http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#
> a13795735
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - - - - - - - - - - -
> 
> This message is intended only for the personal and
> confidential use of the designated recipient(s)
> named above.  If you are not the intended recipient
> of this message you are hereby notified that any
> review, dissemination, distribution or copying of
> this message is strictly prohibited.  This
> communication is for information purposes only and
> should not be regarded as an offer to sell or as a
> solicitation of an offer to buy any financial
> product, an official confirmation of any
> transaction, or as an official statement of Lehman
> Brothers. 
=== message truncated ===


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


RE: access to bean property in struts2

Posted by "Hernandez, David" <da...@lehman.com>.
Sorry, if you want to iterate through the contracts, let's say they're
members of User (name contracts) in jsp:
<s:iterate value="user.contracts">
	<s:property value="someMemberOfContracts" />
</s:iterate>

-----Original Message-----
From: slideharmony [mailto:setoiori@tiscali.it] 
Sent: Friday, November 16, 2007 10:53 AM
To: user@struts.apache.org
Subject: Re: access to bean property in struts2


I have another question:
it is right in struts2 to put beans in session? Assuming to have an
action that retrieve a bean User from the database; the user have a set
of contracts. I want to iterate this set in a jsp page, which ways have
I to do that? I have to put the bean User in session, or is there
something else i can do? maybe using the value stack?



Thilo Ettelt wrote:
> 
> You can expose a property or bean to the JSP Expression language
> (${myPropertyOrBean}) by using s:set taglib.
> 
> 
> - Thilo
> 
> slideharmony wrote:
>> ok, but I read somewhere that I can do that without setting a 
>> property User in my action, using the action stack, or something like

>> this, I believed that last action I have used should be available, or

>> not?
>>
>>
>>
>>
>> Hernandez, David wrote:
>>   
>>> Set the Bean as a member of the Action class and use:
>>> <s:property value="beanVarName.beanMemberName" />
>>>
>>> -----Original Message-----
>>> From: slideharmony [mailto:setoiori@tiscali.it]
>>> Sent: Thursday, November 15, 2007 11:28 AM
>>> To: user@struts.apache.org
>>> Subject: access to bean property in struts2
>>>
>>>
>>> Hello,
>>> how can I access a bean properties from a jsp page?
>>> I have created an action to creare a new account for a generic user,

>>> and I want to print in a jsp page the full name of the new user. 
>>> Usually I put the new User object in session and obtained his 
>>> properties by this way form the jsp page, but probably there is some
other way with strut2.
>>> thank you
>>> --
>>> View this message in context:
>>> http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.h
>>> tml#
>>> a13774814
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
>>> - -
>>> -
>>> - - - - - - -
>>>
>>> This message is intended only for the personal and confidential use 
>>> of the designated recipient(s) named above.  If you are not the 
>>> intended recipient of this message you are hereby notified that any 
>>> review, dissemination, distribution or copying of this message is 
>>> strictly prohibited.  This communication is for information purposes

>>> only and should not be regarded as an offer to sell or as a 
>>> solicitation of an offer to buy any financial product, an official 
>>> confirmation of any transaction, or as an official statement of 
>>> Lehman Brothers.  Email transmission cannot be guaranteed to be 
>>> secure or error-free.
>>> Therefore,
>>> we do not represent that this information is complete or accurate 
>>> and it should not be relied upon as such.  All information is 
>>> subject to change without notice.
>>>
>>> --------
>>> IRS Circular 230 Disclosure:
>>> Please be advised that any discussion of U.S. tax matters contained 
>>> within this communication (including any attachments) is not 
>>> intended or written to be used and cannot be used for the purpose of

>>> (i) avoiding U.S. tax related penalties or (ii) promoting, marketing

>>> or recommending to another party any transaction or matter addressed

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

--
View this message in context:
http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#
a13795735
Sent from the Struts - User mailing list archive at Nabble.com.


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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.

--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.



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


Re: access to bean property in struts2

Posted by slideharmony <se...@tiscali.it>.
I have another question:
it is right in struts2 to put beans in session? Assuming to have an action
that retrieve a bean User from the database; the user have a set of
contracts. I want to iterate this set in a jsp page, which ways have I to do
that? I have to put the bean User in session, or is there something else i
can do? maybe using the value stack?



Thilo Ettelt wrote:
> 
> You can expose a property or bean to the JSP Expression language 
> (${myPropertyOrBean}) by using s:set taglib.
> 
> 
> - Thilo
> 
> slideharmony wrote:
>> ok, but I read somewhere that I can do that without setting a property
>> User
>> in my action, using the action stack, or something like this, I believed
>> that last action I have used should be available, or not?
>>
>>
>>
>>
>> Hernandez, David wrote:
>>   
>>> Set the Bean as a member of the Action class and use:
>>> <s:property value="beanVarName.beanMemberName" /> 
>>>
>>> -----Original Message-----
>>> From: slideharmony [mailto:setoiori@tiscali.it] 
>>> Sent: Thursday, November 15, 2007 11:28 AM
>>> To: user@struts.apache.org
>>> Subject: access to bean property in struts2
>>>
>>>
>>> Hello,
>>> how can I access a bean properties from a jsp page?
>>> I have created an action to creare a new account for a generic user, and
>>> I want to print in a jsp page the full name of the new user. Usually I
>>> put the new User object in session and obtained his properties by this
>>> way form the jsp page, but probably there is some other way with strut2.
>>> thank you
>>> --
>>> View this message in context:
>>> http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#
>>> a13774814
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>> -
>>> - - - - - - -
>>>
>>> This message is intended only for the personal and confidential use of
>>> the
>>> designated recipient(s) named above.  If you are not the intended
>>> recipient of this message you are hereby notified that any review,
>>> dissemination, distribution or copying of this message is strictly
>>> prohibited.  This communication is for information purposes only and
>>> should not be regarded as an offer to sell or as a solicitation of an
>>> offer to buy any financial product, an official confirmation of any
>>> transaction, or as an official statement of Lehman Brothers.  Email
>>> transmission cannot be guaranteed to be secure or error-free. 
>>> Therefore,
>>> we do not represent that this information is complete or accurate and it
>>> should not be relied upon as such.  All information is subject to change
>>> without notice.
>>>
>>> --------
>>> IRS Circular 230 Disclosure:
>>> Please be advised that any discussion of U.S. tax matters contained
>>> within
>>> this communication (including any attachments) is not intended or
>>> written
>>> to be used and cannot be used for the purpose of (i) avoiding U.S. tax
>>> related penalties or (ii) promoting, marketing or recommending to
>>> another
>>> party any transaction or matter addressed herein.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#a13795735
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: access to bean property in struts2

Posted by Thilo Ettelt <te...@carmunity.de>.
You can expose a property or bean to the JSP Expression language 
(${myPropertyOrBean}) by using s:set taglib.


- Thilo

slideharmony wrote:
> ok, but I read somewhere that I can do that without setting a property User
> in my action, using the action stack, or something like this, I believed
> that last action I have used should be available, or not?
>
>
>
>
> Hernandez, David wrote:
>   
>> Set the Bean as a member of the Action class and use:
>> <s:property value="beanVarName.beanMemberName" /> 
>>
>> -----Original Message-----
>> From: slideharmony [mailto:setoiori@tiscali.it] 
>> Sent: Thursday, November 15, 2007 11:28 AM
>> To: user@struts.apache.org
>> Subject: access to bean property in struts2
>>
>>
>> Hello,
>> how can I access a bean properties from a jsp page?
>> I have created an action to creare a new account for a generic user, and
>> I want to print in a jsp page the full name of the new user. Usually I
>> put the new User object in session and obtained his properties by this
>> way form the jsp page, but probably there is some other way with strut2.
>> thank you
>> --
>> View this message in context:
>> http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#
>> a13774814
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> - - - - - - -
>>
>> This message is intended only for the personal and confidential use of the
>> designated recipient(s) named above.  If you are not the intended
>> recipient of this message you are hereby notified that any review,
>> dissemination, distribution or copying of this message is strictly
>> prohibited.  This communication is for information purposes only and
>> should not be regarded as an offer to sell or as a solicitation of an
>> offer to buy any financial product, an official confirmation of any
>> transaction, or as an official statement of Lehman Brothers.  Email
>> transmission cannot be guaranteed to be secure or error-free.  Therefore,
>> we do not represent that this information is complete or accurate and it
>> should not be relied upon as such.  All information is subject to change
>> without notice.
>>
>> --------
>> IRS Circular 230 Disclosure:
>> Please be advised that any discussion of U.S. tax matters contained within
>> this communication (including any attachments) is not intended or written
>> to be used and cannot be used for the purpose of (i) avoiding U.S. tax
>> related penalties or (ii) promoting, marketing or recommending to another
>> party any transaction or matter addressed herein.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>     
>
>   


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


RE: access to bean property in struts2

Posted by slideharmony <se...@tiscali.it>.
ok, but I read somewhere that I can do that without setting a property User
in my action, using the action stack, or something like this, I believed
that last action I have used should be available, or not?




Hernandez, David wrote:
> 
> 
> Set the Bean as a member of the Action class and use:
> <s:property value="beanVarName.beanMemberName" /> 
> 
> -----Original Message-----
> From: slideharmony [mailto:setoiori@tiscali.it] 
> Sent: Thursday, November 15, 2007 11:28 AM
> To: user@struts.apache.org
> Subject: access to bean property in struts2
> 
> 
> Hello,
> how can I access a bean properties from a jsp page?
> I have created an action to creare a new account for a generic user, and
> I want to print in a jsp page the full name of the new user. Usually I
> put the new User object in session and obtained his properties by this
> way form the jsp page, but probably there is some other way with strut2.
> thank you
> --
> View this message in context:
> http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#
> a13774814
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - -
> 
> This message is intended only for the personal and confidential use of the
> designated recipient(s) named above.  If you are not the intended
> recipient of this message you are hereby notified that any review,
> dissemination, distribution or copying of this message is strictly
> prohibited.  This communication is for information purposes only and
> should not be regarded as an offer to sell or as a solicitation of an
> offer to buy any financial product, an official confirmation of any
> transaction, or as an official statement of Lehman Brothers.  Email
> transmission cannot be guaranteed to be secure or error-free.  Therefore,
> we do not represent that this information is complete or accurate and it
> should not be relied upon as such.  All information is subject to change
> without notice.
> 
> --------
> IRS Circular 230 Disclosure:
> Please be advised that any discussion of U.S. tax matters contained within
> this communication (including any attachments) is not intended or written
> to be used and cannot be used for the purpose of (i) avoiding U.S. tax
> related penalties or (ii) promoting, marketing or recommending to another
> party any transaction or matter addressed herein.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#a13788524
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: access to bean property in struts2

Posted by "Hernandez, David" <da...@lehman.com>.
Set the Bean as a member of the Action class and use:
<s:property value="beanVarName.beanMemberName" /> 

-----Original Message-----
From: slideharmony [mailto:setoiori@tiscali.it] 
Sent: Thursday, November 15, 2007 11:28 AM
To: user@struts.apache.org
Subject: access to bean property in struts2


Hello,
how can I access a bean properties from a jsp page?
I have created an action to creare a new account for a generic user, and
I want to print in a jsp page the full name of the new user. Usually I
put the new User object in session and obtained his properties by this
way form the jsp page, but probably there is some other way with strut2.
thank you
--
View this message in context:
http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#
a13774814
Sent from the Struts - User mailing list archive at Nabble.com.


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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.

--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.



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


Re: access to bean property in struts2

Posted by Dave Newton <ne...@yahoo.com>.
In your action:

public User getUser() { return this.user; }

In your JSP:

<s:property value="user.fullName"/>

Through a request wrapper you can also use JSP 2.0 EL
if you're running a JSP 2 container:

${user.fullName}

if you don't mind mixing paradigms.

d.

--- slideharmony <se...@tiscali.it> wrote:

> 
> Hello,
> how can I access a bean properties from a jsp page?
> I have created an action to creare a new account for
> a generic user, and I
> want to print in a jsp page the full name of the new
> user. Usually I put the
> new User object in session and obtained his
> properties by this way form the
> jsp page, but probably there is some other way with
> strut2.
> thank you
> -- 
> View this message in context:
>
http://www.nabble.com/access-to-bean-property-in-struts2-tf4815028.html#a13774814
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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