File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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

Joined: Jan 10, 2002
Posts: 63838

<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] [About Bear] [Books by Bear]

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


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

Joined: Jan 10, 2002
Posts: 63838

"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.

JavaRanch Sheriff
I agree. Here's the link:
subject: if condition for c:out
It's not a secret anymore!