Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
Hi,

Struts 2 tags have value attribute where name of property is used to read the 
value from the bean. If the property is lets say xyz, tag looks for getXyz(). 
Is this possible to customize that so that instead of getXyz(), it looks for 
isXyz()? My boolean property has accessors which starts with isXyz() instead of 
getXyz().

Thx

-Akash



  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread Musachy Barroso
Struts 2(OGNL technically speaking) will call getX() or isX() if one
of them exist, when y.x is evaluated.

musachy

On Fri, Apr 4, 2008 at 1:37 PM, akash agrawal [EMAIL PROTECTED] wrote:
 Hi,

  Struts 2 tags have value attribute where name of property is used to read 
 the value from the bean. If the property is lets say xyz, tag looks for 
 getXyz(). Is this possible to customize that so that instead of getXyz(), it 
 looks for isXyz()? My boolean property has accessors which starts with 
 isXyz() instead of getXyz().

  Thx

  -Akash




   
 
  You rock. That's why Blockbuster's offering you one month of Blockbuster 
 Total Access, No Cost.
  http://tc.deals.yahoo.com/tc/blockbuster/text5.com

  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
Here is my JSP snippet. isXyz() does not work for me. What am I doing 
incorrectly?

s:set name=myBean value=myBeanObject/s:set

s:checkbox name=xyz label=xyzLabel value=%{#myBean.xyz} required=true 
tooltip=xyzTooltip/

Thx.


--- On Fri, 4/4/08, Musachy Barroso [EMAIL PROTECTED] wrote:

 From: Musachy Barroso [EMAIL PROTECTED]
 Subject: Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()
 To: Struts Users Mailing List user@struts.apache.org
 Date: Friday, April 4, 2008, 10:47 AM
 Struts 2(OGNL technically speaking) will call getX() or
 isX() if one
 of them exist, when y.x is evaluated.
 
 musachy
 
 On Fri, Apr 4, 2008 at 1:37 PM, akash agrawal
 [EMAIL PROTECTED] wrote:
  Hi,
 
   Struts 2 tags have value attribute where name of
 property is used to read the value from the bean. If the
 property is lets say xyz, tag looks for getXyz(). Is this
 possible to customize that so that instead of getXyz(), it
 looks for isXyz()? My boolean property has accessors which
 starts with isXyz() instead of getXyz().
 
   Thx
 
   -Akash
 
 
 
 
   
 
   You rock. That's why Blockbuster's offering
 you one month of Blockbuster Total Access, No Cost.
   http://tc.deals.yahoo.com/tc/blockbuster/text5.com
 
  
 -
   To unsubscribe, e-mail:
 [EMAIL PROTECTED]
   For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
 
 -- 
 Hey you! Would you help me to carry the stone?
 Pink Floyd
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
myBean is not null, There are other field which are not boolean and I do get 
them fine.

Thx

--- On Fri, 4/4/08, Musachy Barroso [EMAIL PROTECTED] wrote:

 From: Musachy Barroso [EMAIL PROTECTED]
 Subject: Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()
 To: Struts Users Mailing List user@struts.apache.org
 Date: Friday, April 4, 2008, 11:09 AM
 Are you sure that myBean is not null?
 
 musachy
 
 On Fri, Apr 4, 2008 at 2:05 PM, akash agrawal
 [EMAIL PROTECTED] wrote:
  Here is my JSP snippet. isXyz() does not work for me.
 What am I doing incorrectly?
 
   s:set name=myBean
 value=myBeanObject/s:set
 
   s:checkbox name=xyz
 label=xyzLabel value=%{#myBean.xyz}
 required=true
 tooltip=xyzTooltip/
 
   Thx.
 
 
   --- On Fri, 4/4/08, Musachy Barroso
 [EMAIL PROTECTED] wrote:
 
From: Musachy Barroso [EMAIL PROTECTED]
Subject: Re: Struts2 tags behaviour
 customizable? isXyz() instead of getXyz()
To: Struts Users Mailing List
 user@struts.apache.org
Date: Friday, April 4, 2008, 10:47 AM
 
 
   Struts 2(OGNL technically speaking) will call
 getX() or
isX() if one
of them exist, when y.x is
 evaluated.
   
musachy
   
On Fri, Apr 4, 2008 at 1:37 PM, akash agrawal
[EMAIL PROTECTED] wrote:
 Hi,

  Struts 2 tags have value attribute where
 name of
property is used to read the value from the
 bean. If the
property is lets say xyz, tag looks for
 getXyz(). Is this
possible to customize that so that instead of
 getXyz(), it
looks for isXyz()? My boolean property has
 accessors which
starts with isXyz() instead of getXyz().

  Thx

  -Akash





   
 
  You rock. That's why Blockbuster's
 offering
you one month of Blockbuster Total Access, No
 Cost.
 
 http://tc.deals.yahoo.com/tc/blockbuster/text5.com


   
 -
  To unsubscribe, e-mail:
[EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]


   
   
   
--
Hey you! Would you help me to carry the
 stone?
Pink Floyd
   
   
 -
To unsubscribe, e-mail:
 [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
   
 
   You rock. That's why Blockbuster's offering
 you one month of Blockbuster Total Access, No Cost.
   http://tc.deals.yahoo.com/tc/blockbuster/text5.com
 
  
 -
   To unsubscribe, e-mail:
 [EMAIL PROTECTED]
   For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
 
 -- 
 Hey you! Would you help me to carry the stone?
 Pink Floyd
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread David Durham, Jr.
On Fri, Apr 4, 2008 at 1:17 PM, akash agrawal [EMAIL PROTECTED] wrote:
 myBean is not null, There are other field which are not boolean and I do get 
 them fine.

Is it boolean, or Boolean?  I've seen situations where I was hoping
isX would return a reference to a Boolean (when reference with
JavaBean dot notation), but I had to implement a getX instead.  Just 2
cents.

-Dave

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
David,

It is a Boolean property but I still think it should work no matter whether it 
is boolean or Boolean. APIs I am using are not mine so I can't change the bean, 
but there are workaround I can put in although they aren't pretty. I was hoping 
something can be done on the framework (Struts2) side.

Thx.
-Akash


--- On Fri, 4/4/08, David Durham, Jr. [EMAIL PROTECTED] wrote:

 From: David Durham, Jr. [EMAIL PROTECTED]
 Subject: Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()
 To: Struts Users Mailing List user@struts.apache.org, [EMAIL PROTECTED]
 Date: Friday, April 4, 2008, 11:33 AM
 On Fri, Apr 4, 2008 at 1:17 PM, akash agrawal
 [EMAIL PROTECTED] wrote:
  myBean is not null, There are other field which are
 not boolean and I do get them fine.
 
 Is it boolean, or Boolean?  I've seen situations where
 I was hoping
 isX would return a reference to a Boolean (when reference
 with
 JavaBean dot notation), but I had to implement a getX
 instead.  Just 2
 cents.
 
 -Dave
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread David Durham, Jr.
On Fri, Apr 4, 2008 at 1:39 PM, akash agrawal [EMAIL PROTECTED] wrote:
  It is a Boolean property but I still think it should work no matter whether 
 it is boolean or Boolean. APIs I am using are not mine so I can't change the 
 bean, but there are workaround I can put in although they aren't pretty. I 
 was hoping something can be done on the framework (Struts2) side.

Ask not what the framework can do for you, but what you can do for the
framework ...   it's Friday.  Seriously though, if you need to provide
a getMyBoolean, and you can't modify the original class, you can just
provide a wrapper to translate getMyBoolean to isMyBoolean.  If it's a
public class as I think the JavaBean spec requires it to be, you can
just extend it, otherwise you need a delegator for not just this
property but all the others.  Anyway, it's not really clear that this
is what you need anyway, so this is just more speculation.


--Dave

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread Laurie Harper

David Durham, Jr. wrote:

On Fri, Apr 4, 2008 at 1:39 PM, akash agrawal [EMAIL PROTECTED] wrote:

 It is a Boolean property but I still think it should work no matter whether it 
is boolean or Boolean. APIs I am using are not mine so I can't change the bean, 
but there are workaround I can put in although they aren't pretty. I was hoping 
something can be done on the framework (Struts2) side.


Ask not what the framework can do for you, but what you can do for the
framework ...   it's Friday.  Seriously though, if you need to provide
a getMyBoolean, and you can't modify the original class, you can just
provide a wrapper to translate getMyBoolean to isMyBoolean.  If it's a
public class as I think the JavaBean spec requires it to be, you can
just extend it, otherwise you need a delegator for not just this
property but all the others.  Anyway, it's not really clear that this
is what you need anyway, so this is just more speculation.


The JavaBean specification only talks about boolean properties; it 
doesn't mention Boolean (section 8.3.2). But rather than messing with an 
'adapter' sub-class, I would consider either (a) creating a BeanInfo 
class or (b) simply living with it and just being explicit in OGNL 
expressions like so:


s:checkbox name=xyz label=xyzLabel value=%{#myBean.isXyz()} 
required=true tooltip=xyzTooltip/


i.e. use method-call rather than simple property syntax.

L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]