Hi,
I am using the following code in my JSP. Actually when i submit this jsp to a servlet then it sets the value of location attribute using request.setAttribute() and forwards it using RequestDispatcher and include.But when the JSP page reloads there is no effect of if-else.
<% if(request.getAttribute("location").equals("Chandigarh")){ %>
<select name="Location">
<Option value="Chandigarh" selected>Chandigarh</Option>
<Option value="Pune">Pune</Option>
</select>
<%}
else if(request.getAttribute("location").equals("Pune")){%>
<select name="Location">
<Option value="Pune" selected>Pune</Option>
<Option value="Chandigarh">Chandigarh</Option>
</select>
<% }
else{ %>
<select name="Location">
<Option value="Banglore" selected>Banglore</Option>
<Option value="Chandigarh">Chandigarh</Option>
</select>
<% } %>
I always see the code that is apecified in else block.
Please tell me the problem in this code.
Thanks