aspose file tools*
The moose likes JSP and the fly likes if condition for c:out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "if condition for c:out" Watch "if condition for c:out" New topic
Author

if condition for c:out

liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
Can someone tell me how I could incorporate if condition in the following?
At this point I have:
<cut value="${param.TO6}"/>-<cut value="${param.TO7}"/>

It works and I get "-" in the web page no matter what.
I'd like to change the above to something like this: "if ${param.TO7} != null the print "-" and print ${param.TO7}
Thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

<c:if>, or, if using JSP 2.0, the ternary operator (?).

Please read the text at the top of the JSP forum and adhere to the policy of including the versions of JSP and JSTL that you are using when posting questions.
[ August 01, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dhulipalla
Greenhorn

Joined: Aug 02, 2006
Posts: 4
For consitions like if else we have to use <c:choose> tag

Ex:

<c:choose>
<%-- there can be any no of 'c:when' statements --%>
<c:when test="${string == null || empty string}">
Display True....
</c:when>
<ctherwise>
Dsiplay False ....
</ctherwise>
</c:choose>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

"Dhulipalla Dhulipalla",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: if condition for c:out
 
Similar Threads
jstl question
iterating over hashmap using jstl
html to struts tag
simple JSTL question
JSF TreeMap Iteration Problem Using JSTL In XHTML