You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Peters, John" <Jo...@bcbsfl.com> on 2008/03/08 04:56:40 UTC

Struts get string and is boolean

Is it possible to have multiple methods for the same value?
Then have the jsp either load a text box or a check box
For example
Depending the circumstance I load setValue(boolean) or setValue(String).
Then can the jsp page create either a text box or a check box?



Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.  The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed.  This document may contain material that is privileged or protected from disclosure under applicable law.  If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.


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


RE: Struts get string and is boolean

Posted by "Peters, John" <Jo...@bcbsfl.com>.
Thanks....sorry I missed it......inbox was cluttered 

-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com] 
Sent: Thursday, March 13, 2008 9:27 AM
To: Struts Users Mailing List
Subject: RE: Struts get string and is boolean

--- "Peters, John" <Jo...@bcbsfl.com> wrote:
> Any ideas? 

I haven't seen any replies other than my own.

Dave

> From: Peters, John
> 
> Is it possible to have multiple methods for the same value?
> Then have the jsp either load a text box or a check box For example 
> Depending the circumstance I load setValue(boolean) or
setValue(String).
> Then can the jsp page create either a text box or a check box?


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





Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.  The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed.  This document may contain material that is privileged or protected from disclosure under applicable law.  If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.


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


RE: Struts get string and is boolean

Posted by Dave Newton <ne...@yahoo.com>.
--- "Peters, John" <Jo...@bcbsfl.com> wrote:
> Any ideas? 

I haven't seen any replies other than my own.

Dave

> From: Peters, John 
> 
> Is it possible to have multiple methods for the same value?
> Then have the jsp either load a text box or a check box For example
> Depending the circumstance I load setValue(boolean) or setValue(String).
> Then can the jsp page create either a text box or a check box?


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


RE: Struts get string and is boolean

Posted by "Peters, John" <Jo...@bcbsfl.com>.
Any ideas? 

-----Original Message-----
From: Peters, John 
Sent: Friday, March 07, 2008 10:57 PM
To: 'Struts Users Mailing List'
Subject: Struts get string and is boolean

Is it possible to have multiple methods for the same value?
Then have the jsp either load a text box or a check box For example
Depending the circumstance I load setValue(boolean) or setValue(String).
Then can the jsp page create either a text box or a check box?



Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.  The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed.  This document may contain material that is privileged or protected from disclosure under applicable law.  If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.


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


Re: Struts get string and is boolean

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Dave Newton wrote:
>>  For example Depending the circumstance 
>> I load setValue(boolean) or setValue(String). 
>
> In S2 it could cause problems with the form tags; it expects form values to
> follow JavaBean standards. I'm not sure what would happen.
>
> Dave
>
>   
You can have the two setters if you want, but no matter what you can 
only have one getter, and Xwork will always match the string rather than 
the boolean.

If you like, make the property a String.  Use a checkbox or input in 
your JSP dynamically.  When you submit the form the parameter 
interceptor will set the value of the string to the value of the 
checkbox/input, which will be the value, or "true" or "yes" depending on 
your form and the user's brower. You'll have to handle further 
conversion within your action.
This sucks though because you won't get the automatic "not checked" 
handling, and because IE sends "yes" instead of the checked value (IIRC).


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


Re: Struts get string and is boolean

Posted by Dave Newton <ne...@yahoo.com>.
--- "Peters, John" <Jo...@bcbsfl.com> wrote:
> Is it possible to have multiple methods for the same 
> value? Then have the jsp either load a text box or a 
> check box For example Depending the circumstance 
> I load setValue(boolean) or setValue(String). Then can 
> the jsp page create either a text box or a check box?

Automatically? None that I know of, for either version of Struts. You'd have
to code behavior like that in either the action or the presentation side (or
a combination of both).

In S2 it could cause problems with the form tags; it expects form values to
follow JavaBean standards. I'm not sure what would happen.

Dave


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