You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alex Colic <al...@pop-ware.com> on 2001/04/06 16:26:19 UTC

Newbie question #3

Hi, I am porting one of my web apps to the struts infrastructure. I have a
few questions that should get me on the right track. I hope someone out
there can help.

On one of my pages I am getting an object that is already in the session
via:

<jsp:useBean id="user" scope="session" class="com.mycompany.myClass.User"/>

The User class has a method getEmployee() that itself has a method
getDepartment();

I want to set a text box to the getDepartment() value.

In a standard case the property value is a String, in this case the property
I get is an object of type User that I need to call methods on. How do you
do that in the below tag?

<html:text name="user" property="employee.getDepartment()" size="16"
maxlength="20" />

Any help is this case is highly appreciated.

Regards

Alex Colic, HBA, B. Ed
PopWare Inc. "Driving down the cost of conversions!"
E-Mail: Alex.Colic@pop-ware.com
Tel: 1-905-777-8171 ext. 104
Fax: 1-905-777-0132


Re: Newbie question #3

Posted by Jim Crossley <jc...@ifleet.com>.
<html:text name="user" property="employee.department" size="16"
maxlength="20" />


Alex Colic wrote:
> 
> Hi, I am porting one of my web apps to the struts infrastructure. I have a
> few questions that should get me on the right track. I hope someone out
> there can help.
> 
> On one of my pages I am getting an object that is already in the session
> via:
> 
> <jsp:useBean id="user" scope="session" class="com.mycompany.myClass.User"/>
> 
> The User class has a method getEmployee() that itself has a method
> getDepartment();
> 
> I want to set a text box to the getDepartment() value.
> 
> In a standard case the property value is a String, in this case the property
> I get is an object of type User that I need to call methods on. How do you
> do that in the below tag?
> 
> <html:text name="user" property="employee.getDepartment()" size="16"
> maxlength="20" />
> 
> Any help is this case is highly appreciated.
> 
> Regards
> 
> Alex Colic, HBA, B. Ed
> PopWare Inc. "Driving down the cost of conversions!"
> E-Mail: Alex.Colic@pop-ware.com
> Tel: 1-905-777-8171 ext. 104
> Fax: 1-905-777-0132