0

Why is this code not working????

<c:if test ="${sessionScope.qCounter == 0}">
                      <!-- {((Quiz1) (sessionScope.quizVal)).correctAnswer(sessionScope.boxval)) == 'true'}">!-->
                     <br><font size='3' color = 'red'>Your last answer was not correct!
                 Please try again!!</font><br>
                 </c:if>

qCounter and quizVal are a session scope attributes I declared like .

HttpSession s = request.getSession();
         s.setAttribute("quiz", new Quiz1());
     Quiz1 q = (Quiz1)s.getAttribute("quiz");
      s.setAttribute("qCounter", "1");
          request.setAttribute("quizVal", q);

please help :( why is my 'if' not doing anything?

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Stefano Mtangoo
0

I'm new to JSp but wouldn't tag begin with <% instead of <c:?

<% 
  if(sessionScope.qCounter == 0){
  <!--............do your stuff.....-->
}
else{
  <!--.................do your stuff .........-->
}
  %>
0

I'm new to JSp but wouldn't tag begin with <% instead of <c:?

<% 
  if(sessionScope.qCounter == 0){
  <!--............do your stuff.....-->
}
else{
  <!--.................do your stuff .........-->
}
  %>

Not if we are talking about JSTL library (check the end of me MVC tutorial ;) )

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.