I am developing a java program using JSP&forms, first page will ask user to enter two number and there is a small button to proceed to the next page and the second page will ask user to select any one of the radio buttons from among the list and the list typically contains addition.subtraction,multiplication,division,so after user selection user need to click result button,then according to user operation result should be displayed . to do this i have written three JSP programs using forms.
but in
dont no how to catch the radio action ,can some body tell me how can i do this
Firstpage.jsp
<html>
<head>
<title>POST METHOD</title>
</head>
<body>
<form action="secondpage.jsp" method="POST" >
FirstNumber:<input type="text" name="FIRSTNUMBER"><br>
SecondNumber:<input type="text" name="SECONDNUMBER"><br>
<input type="submit" value="Proceed" >
</form>
</body>
</html>
secondPage.jsp
<html>
<head>
<title>POST METHOD</title>
</head>
<body>
<form action="Result.jsp" method="POST" >
ADD:<input type="radio" name="ADD" value="ADD" ><br>
SUB:<input type="radio" name="SUB" value="SUB" ><br>
DIV:<input type="radio" name="DIV" value="DIV" ><br>
MUL:<input type="radio" name="MUL" value="MUL" ><br>
<input type="submit" value="Result" ><br>
</form>
</body>
</html>
Result.jsp
<html>
<head>
<title>ADD</title>
</head>
<body>
<% if(ADD==Result)
String s1=request.getParameter("FIRSTNUMBER");
String s2=request.getParameter("SECONDNUMBER");
int add=Integer.parseInt(s1)+Integer.parseInt(s2);
out.println("Result=" + add);
%>
</body>
</html>
anybody have idea..please tell me