You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Collins <ja...@blueyonder.co.uk> on 2006/02/23 00:12:09 UTC

Off Topic Expression Language question

Hi All,

Appologies for the off topic posting. Does anyone Know how I can access a 
bean property that takes a parameter using EL.

For example if in a bean I have define a name property with public String 
getName(){return name;}

I can access this with EL

${mybean.name}

But suppose in my bean the method signature is:

public String getName(String someParam){return name;}

How would I access this in EL and pass a value in for the parameter?

Any ideas would be appreciated.

Thanks

Jim 



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


Re: Off Topic Expression Language question

Posted by Jim Collins <ja...@blueyonder.co.uk>.
Hi Leon,

Thanks for the reply. I refactored my bean so that the method no longer 
takes a String parameter which is as per the bean spec. I might have a look 
at your suggestion to see if that would have worked.

Regards

Jim
----- Original Message ----- 
From: "Leon Rosenberg" <ro...@googlemail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, February 23, 2006 2:26 PM
Subject: Re: Off Topic Expression Language question


is it always the same object (class) and the same method you are
calling? In this case I'd suggest you write a three-line custom tag
for it. If you have to do it more often, maybe a tag using reflection
api would be an answer. I you write one, let me know, I may need one
too :-)

regards
Leon

On 2/23/06, Jim Collins <ja...@blueyonder.co.uk> wrote:
> Hi All,
>
> Appologies for the off topic posting. Does anyone Know how I can access a
> bean property that takes a parameter using EL.
>
> For example if in a bean I have define a name property with public String
> getName(){return name;}
>
> I can access this with EL
>
> ${mybean.name}
>
> But suppose in my bean the method signature is:
>
> public String getName(String someParam){return name;}
>
> How would I access this in EL and pass a value in for the parameter?
>
> Any ideas would be appreciated.
>
> Thanks
>
> Jim
>
>
>
> ---------------------------------------------------------------------
> 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





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


Re: Off Topic Expression Language question

Posted by Leon Rosenberg <ro...@googlemail.com>.
is it always the same object (class) and the same method you are
calling? In this case I'd suggest you write a three-line custom tag
for it. If you have to do it more often, maybe a tag using reflection
api would be an answer. I you write one, let me know, I may need one
too :-)

regards
Leon

On 2/23/06, Jim Collins <ja...@blueyonder.co.uk> wrote:
> Hi All,
>
> Appologies for the off topic posting. Does anyone Know how I can access a
> bean property that takes a parameter using EL.
>
> For example if in a bean I have define a name property with public String
> getName(){return name;}
>
> I can access this with EL
>
> ${mybean.name}
>
> But suppose in my bean the method signature is:
>
> public String getName(String someParam){return name;}
>
> How would I access this in EL and pass a value in for the parameter?
>
> Any ideas would be appreciated.
>
> Thanks
>
> Jim
>
>
>
> ---------------------------------------------------------------------
> 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