The moose likes JSP and the fly likes Using c:if Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Using c:if" Watch "Using c:if" New topic
Author

Using c:if

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 224
I am having a problem testing the value of a variable using c:if i am currently trying something like (if val variable in request scope is equal to hello)
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

<c:if test="${requestScope.val=='hello'}" >

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 13842

Just do the obvious thing. (The obvious thing doesn't include escaping of quotes, or whatever those backslashes are for.)
Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 224
<c:if test="${requestScope.val=='hello'}" > worked
Seetharaman Venkatasamy
Bartender

Joined: Jan 28, 2008
Posts: 4503


concentrate above idiom! :)


Not everything that counts can be counted, and not everything that can be counted counts-Albert Einstein
 
 
subject: Using c:if
 
Threads others viewed
JSTL Expressions
Help in JSTL And EL
setting var attribute in classic custom tag
JSTL c:if not working, but c:out is working
Problem with nested c:forEach
developer file tools