How to detect empty array list / databean on JSP?

2005-01-16 Thread Manisha Sathe
I am putting one arraylist and one javabean object with 
request.setAttribute.. 
 
I can access this in JSP. But how i can detect that Arraylist and/or Bean is 
empty ? 
 
regards
Manisha


-
Do you Yahoo!?
 The all-new My Yahoo! – Get yours free!

Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Wendy Smoak
From: Manisha Sathe [EMAIL PROTECTED]
I am putting one arraylist and one javabean object with 
request.setAttribute..
I can access this in JSP. But how i can detect that Arraylist and/or Bean 
is empty ?
With JSTL, assuming you have done
request.setAttribute( myList, list );
%@ taglib uri=http://java.sun.com/jstl/core; prefix=c %
c:if test=${empty myList}
  it's empty!
/c:if
I'm not sure what it means for a bean to be empty though.  Maybe you would 
check to see if a particular property is null?

--
Wendy Smoak

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


Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Kishore Senji
If you are not using JSTL, you can do the same thing using logic:empty/


On Sun, 16 Jan 2005 16:04:51 -0800 (PST), Manisha Sathe
[EMAIL PROTECTED] wrote:
 I am putting one arraylist and one javabean object with 
 request.setAttribute..
 
 I can access this in JSP. But how i can detect that Arraylist and/or Bean is 
 empty ?
 
 regards
 Manisha
 
 
 -
 Do you Yahoo!?
 The all-new My Yahoo!  Get yours free!


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



Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Vic
 likey that any decsions' you shound do in Controller/Action.
.V
Manisha Sathe wrote:
I am putting one arraylist and one javabean object with request.setAttribute.. 

I can access this in JSP. But how i can detect that Arraylist and/or Bean is empty ? 

regards
Manisha
		
-
Do you Yahoo!?
The all-new My Yahoo!  Get yours free!
 


--
RiA-SoA w/JDNC http://www.SandraSF.com forums
- help develop a community
My blog http://www.sandrasf.com/adminBlog
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Yen
Hi, I am new to struts..
I saw people using the logic for the validation checking. But how to use 
it..? For each attributes in the form are different..?

rgds,
- Original Message - 
From: Kishore Senji [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Monday, January 17, 2005 8:35 AM
Subject: Re: How to detect empty array list / databean on JSP?

If you are not using JSTL, you can do the same thing using logic:empty/

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


Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Manisha Sathe
Thanks Wendy, 
 
For data bean empty - what i mean is - i select one particular record 
depending on ID given, and put in bean. if i do not find any record then can i 
check it at front end and display 'No record found'
 
But i think u mean to say i can check for (MyBean.MyPropert == null ) ? right ?
 
regards
Manisha
 


Wendy Smoak [EMAIL PROTECTED] wrote:
From: Manisha Sathe 
I am putting one arraylist and one javabean object with 
request.setAttribute..
 I can access this in JSP. But how i can detect that Arraylist and/or Bean 
 is empty ?

With JSTL, assuming you have done
request.setAttribute( myList, list );



it's empty!


I'm not sure what it means for a bean to be empty though. Maybe you would 
check to see if a particular property is null?

-- 
Wendy Smoak




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



-
Do you Yahoo!?
 Yahoo! Mail - You care about security. So do we.

Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Wendy Smoak
From: Manisha Sathe [EMAIL PROTECTED]
For data bean empty - what i mean is - i select one particular record 
depending on ID given,
and put in bean. if i do not find any record then can i check it at front 
end and display 'No record found'
But i think u mean to say i can check for (MyBean.MyPropert == null ) ? 
right ?
Yes, or, since you know in the Action that you haven't found the record, you 
could forward to a 'no data' page rather than the one that displays the 
data.

--
Wendy Smoak 


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


Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Eddie Bush
Or ... you could create an error for that circumstance and have that
displayed on the same page ... not probably how I'd do it, but it's
certainly a way.

Personally, since you're probably displaying the data in a tabular
format, I would prefer to display a row that spans all columns and
simply displays a message such as Your Query Returned No Results. or
something similar - something meaningful to the context (ie. No POs
matched your criteria.).

Good Luck,

Eddie

On Sun, 16 Jan 2005 20:59:00 -0700, Wendy Smoak [EMAIL PROTECTED] wrote:
 From: Manisha Sathe [EMAIL PROTECTED]
  For data bean empty - what i mean is - i select one particular record
  depending on ID given,
  and put in bean. if i do not find any record then can i check it at front
  end and display 'No record found'
  But i think u mean to say i can check for (MyBean.MyPropert == null ) ?
  right ?
 
 Yes, or, since you know in the Action that you haven't found the record, you
 could forward to a 'no data' page rather than the one that displays the
 data.
 
 --
 Wendy Smoak
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Eddie Bush

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



Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Manisha Sathe

Thanks to all for helping me out,

Cheers

Manisha


-
Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.

Re: How to detect empty array list / databean on JSP?

2005-01-16 Thread Dakota Jack
Just to make sure people are clear about ${empty param.choice} is true
only if the choice parameter was not specified on a form, e.g. there
is no input field named choice or, with a set of check boxes, if the
user did not specify a checkbox in the group named choice).  Also,
${empty sessionScope.choice} is true if there is no session-scoped
variable named choice or if the name is an empty string or some
other empty collection.  The variable must exist and have a value to
be false in this case.  This parameter might have been more accurately
called no_value rather than empty.

Jack

On Sun, 16 Jan 2005 21:03:41 -0800 (PST), Manisha Sathe
[EMAIL PROTECTED] wrote:
 
 Thanks to all for helping me out,
 
 Cheers
 
 Manisha
 
 
 -
 Do you Yahoo!?
  Read only the mail you want - Yahoo! Mail SpamGuard.
 


-- 
--

You can lead a horse to water but you cannot make it float on its back.

~Dakota Jack~

You can't wake a person who is pretending to be asleep.

~Native Proverb~

Each man is good in His sight. It is not necessary for eagles to be crows.

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---

This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.

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