Im having trouble understanding exactly how JSP works in terms of sessions...basically I am setting a session in a different JSP as follows:
<%
String category = request.getParameter("category");
session.setAttribute("category", category); %>
then in another page I am using if conditions to generate HTML based on which category has been posted e.g.:
<% String category = (String) session.getAttribute("category");
if(category == "movie") {
out.println("Movie Details");
} else if (category == "music") {
out.println("Music Details");
} %>
But it seems neither of the two if statements are being hit but if I actually print out the category variable it is printed out correctly i.e. movie or music is being displayed. Is there some concept of sessions which I have not grasped? I have searched endless pages trying to find an answer for this :/ Thanks in advance.