Solved

Using tag library to check if  a object is null

Posted on 2004-04-08
2
2,411 Views
Last Modified: 2007-12-19
I would like to use the tag library to see if  the object is null.
The object is set in the session. In my JSP I get the object from the session.
The first thing i want to do is check if it is null- it it is nulll i print a message otherwise i go ahead and do some other stuff
this is what i have:
<logic:equal parameter="customers" value="null">  
      <B> Search string returned 0 records </B>
      </logic:equal>

<logic:notEqual parameter="customers" value="null">  
      //DO HTML STUFF
      </logic:notEqual>

I have a lot of HTML in my JSP - hece i did not use an if-else condition as it was tooconfusing.
Could someone help out with this or give me some info as to how i canuse if-else , i think i am messing up with the braces
thanks
0
Comment
Question by:aswam1975
  • 2
2 Comments
 
LVL 7

Expert Comment

by:searlas
ID: 10785189
use logic:present, not logic:equal

<logic:present parameter="customer">
<B> Search string returned 0 records </B>
</logic:present>

<logic:notPresent parameter="customers">  
     //DO HTML STUFF
</logic:notPresent>
0
 
LVL 7

Accepted Solution

by:
searlas earned 30 total points
ID: 10785202
If you're really storing things in the session (which has nothing to do with parameter) then use logic:empty and logic:notEmpty

<logic:empty name="yourbean" scope="session">
...
</logic:empty>

and/or

<logic:empty name="yourbean" property="someprop" scope="session">
....
</logic:empty>
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now