wood burning stoves*
The moose likes Struts and the fly likes Using c:if ,logic:empty to check existence of bean data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using c:if ,logic:empty to check existence of bean data" Watch "Using c:if ,logic:empty to check existence of bean data" New topic
Author

Using c:if ,logic:empty to check existence of bean data

lohithbusi reddy
Greenhorn

Joined: Mar 01, 2006
Posts: 2
I have set the properties of bean to null. I want to check it using <c:if> or <logic:empty>, I should not use any properties of the bean in these tags.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Do you have a question or an issue?

- Brent
lohithbusi reddy
Greenhorn

Joined: Mar 01, 2006
Posts: 2
It is an issue for me. Plz help
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There is no built-in function either in the Struts <logic:xxx> tags or in JSTL to check whether all the properties of a bean are null. You would have to write such a function yourself.

In the bean, just write a method isAllPropertiesNull() that returns true if all properties are null, and false if they aren't.

Then in your jsp:

<if test="${myBean.allPropertiesNull}">


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using c:if ,logic:empty to check existence of bean data
 
Similar Threads
Break out of a logic block using logic tags
display data
How to update a bean propertly...over a JSP..?
no getter method for property:... of bean "InboxForm"
logic empty