Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

if condition for c:out

 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65221
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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 ]
 
Dhulipalla
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65221
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic