Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes tag textfield: how to avoid blank values while displaying in jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "tag textfield: how to avoid blank values while displaying in jsp page" Watch "tag textfield: how to avoid blank values while displaying in jsp page" New topic
Author

tag textfield: how to avoid blank values while displaying in jsp page

Nandish Sri
Ranch Hand

Joined: Jan 19, 2004
Posts: 45

I am using struts 2 textfield tag to display values with label. Sometimes these tags may have value or sometimes empty string or null.
I want to display these values ONLY when they are having values [Non Empty]. Currently if it contains blank values, only labels are displaying. I want to avoid this.
Is there any configuration for this ? If Yes please let me know. If no, what is the alternative for this ?



Nandish
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You'd need to wrap them in something that checks for the presence of a value, like JSTL's <c:if>, or S2's <s:if>.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tag textfield: how to avoid blank values while displaying in jsp page
 
Similar Threads
Iterate a String Array of the ActionForm
JTextField
How to Write This Tag Handler
gui problems
JSF dataTable issue