minil
minil

Reputation: 7135

Check empty string in jsp

How to check for Empty String/Null String in Struts-JSP page.

Struts Tag - does not works?

Upvotes: 10

Views: 18849

Answers (3)

kgautron
kgautron

Reputation: 8263

<logic:empty param="<%= yourString %>">

or if the string you want to check is a property of a bean :

<logic:empty name="yourBean" property="yourBeanStringProperty">

Upvotes: 4

souLTower
souLTower

Reputation: 1

String foo = null;
if(foo == null or foo.length() ==0) // The string is null

Upvotes: -5

Taylor Leese
Taylor Leese

Reputation: 52292

See below:

<c:if test='${not empty param.whatever}'>
   ...
</c:if>

Upvotes: 21

Related Questions