Great...then I stand corrected, and I'll cleanup some of my code :)
Khalid
-Original Message-
From: Brian Lee [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 7:58 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Struts Dilemma
You don't need the g
uts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: Struts Dilemma
Date: Thu, 6 Nov 2003 19:48:53 -0800
I do the following:
// in the bean
Public boolean isActive() {
if (blah)
return
I do the following:
// in the bean
Public boolean isActive() {
if (blah)
return true;
return false;
}
// if I know that this method will be used in jsp, I also write the
following:
Public boolean getIsActive() {
if (isActive())
return true;
Hi
JSTL logical operators seems to be a solution.
Mohan
> Often when writing a bean for use by a tag, I seem to be writing a
> equivalent method that returns a string value for a boolean property.
>
> For example:
>
> If I mean to pass a boolean property isInactive, I am also writing a
> getIn
When I create a form exposing a boolean property I only write a;
public void setInactive(boolean flag){}
public boolean isInactive(){}
The inactive form input will have the value "true" and "false" properly
handled, I know it also supports other forms of true and false but I
have only tested "
You don't have to have a string method to convert boolean <--> string.
Just have boolean in form and let struts handle it.
-Original Message-
From: Srinivas Gunturu [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 11:30 AM
Subject: Struts Dilemma
Often when writing a bean fo
I guess this will work for form beans.
What if the flag I am trying to query is not in the form bean but is in a session
bean? Would you do the same? This is where I am having hardtime to create these
equivalent methods that return string while rest of my business delegates use boolean
method
I think the best way to avoid this is to always use Strings and only Strings
for all form values (except Collections). Then your action class can
convert to/from the desired type when it creates the transfer object to pass
to the business delegate. If you combine this approach with the struts
val
Try the or tags...
-Original Message-
From: Srinivas Gunturu [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 12:30 PM
Subject: Struts Dilemma
Often when writing a bean for use by a tag, I seem to be writing a equivalent method
that returns a string value for a boolean prop
9 matches
Mail list logo