I have a servlet S which captures the request parameter of the select field option value from JSP A and stores it in request scope.
String test = request.getParameter("option");
request.setAttribute("select",test);
now this servlet S after processing redirects me again to same JSP A, now in JSP A I have the same option fields and also I have code something like,
<select name="option">
<c:choose>
<c:when test="${select} == All">
<option id="id" class="cl" value="All" selected>Items</option>
</c:when>
<c:otherwise>
<option id="id" class="cl" value="All">All Items</option>
</c:otherwise>
</c:choose>
</select>
But for some reasons code never goes into c:when and it goes directly otherwise section.
Though I have used extensively JSTL,but for some reasons I am unable to get this up.I know value exists in request scope and can see it via c:out tag.Is it possible that we do the post backs to the same page again and again for same session with new values ? Already spend a day on this issue so need third eye to see if I am missing something silly ? Appreciate if someone can take a look.
This is wrong.
The entire expression has to go inside
${}and strings needs to be quoted.See also:
Unrelated to the concrete problem, your concrete functional requirement can be solved in a much simpler manner, without that the servlet needs to copy the parameter:
See also: