jsp - jstl. help with comparison of strings. newbie

  • Thread starter michel.kowalczyk
  • Start date
M

michel.kowalczyk

Hi,
I am having problems with comparing two strings. The code should run
one action if they are equal or another if they are not equal. In my
version the 2 strings are always not equal eventhough they appear to me
equal.

This is my code:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<c:set var="currentEventString" scope="page" value="Something"/>
<html>
..
..
..
<c:choose>
<c:when test="${'${currentEventString}' eq Something}">
do something
</c:when>
<c:eek:therwise>
do another thing
</c:eek:therwise>
</c:choose>
..
..
..
</html>

Does this code have the right to work properly ??

TIA
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top