I have this Jsp file
<SELECT name="brandsFrom" onchange="as()">
<c:forEach items="${brandsSelectedList}" var="brands">
<c:if test="${brands.name == nam}">
<option value="${brands.id}">${brands.id}</option>
</c:if>
</c:forEach>
</SELECT>
i have declared nam above this code like
<%!
String nam;
%>
<%
nam=request.getParameter("name");
out.println("value in the string ="+nam+"+");
%>
When i use
<c:if test="${brands.name == nam}">
the code doesn't rum whereas when i use something like this
<c:if test="${brands.name == 'Denim'}">
the code runs . Why am i not being able to use nam variable ??