I, as well, am having issues with some radio buttons. Here is my code:
-- first JSP --
<html>
<body bgcolor="#CCCC99">
<table>
<form method=get action=display.jsp>
<tr>
<td>Name: <input type="text" name="usrname" size="15"></td>
</tr>
<tr>
<td><input type="submit" value="Go!"></td>
</tr>
<tr>
<td><input type="radio" value="Yes" name="button">Yes</td>
<td><input type="radio" value="No" name="button">No</td>
</tr>
</form>
</table>
</body>
</html>
-- second JSP --
<%@ page import="javax.servlet.*" %>
<html>
<% if(request.getParameter("button") == "Yes"){ %>
Hello, <%= request.getParameter("usrname") %>.
<% } else { %>
Sorry, you don't want your name displayed.
<% }; %>
</html>
The problem is that the "if" statement is always returning false. I changed the "==" to "!=" and the initial condition ran. I do not see how this could be possible. Moreover, is there an implicit conversion between a "response" object and a string object for the string comparison operator or do I need to do that manually (using casting)?
Thanks in advance.