Hi, Can you tell mw what is wrong here? out.println("<TR><TD><INPUT TYPE=radio NAME=abc VALUE=\"subract\">Subtract Numbers</TD></TR>"); String selection = req.getParameter("abc"); if(selection.equals("subtract")) // subtract numbers. I have doubts about the inverted comas in the above 3 statements.
I do not see anything wrong with the statements(syntax wise). Are you generating an error message? Are you talking about the escape character("\")? Please elaborate. Craig.
Lucky Singh
Ranch Hand
Joined: Jan 19, 2004
Posts: 125
posted
0
Ok, i just checked and syntax seems all ok to me. I want to process this form, should I have a doGet() to display the form and doPost() to process it. I want to do it within the same doGet(). can it be done within the same method? On subtracting the numbers my servlet should display this form again. public class AServlet { public void doGet() // display form. //display response + empty form. }
Is the syntax for the form ok? out.println("<FORM METHOD = \"get\" ACTION = \"AServlet\" >"); Why does the System.out.println() not work with servlets? How do I make it work so that its easy for me to debug.
Lucky Singh
Ranch Hand
Joined: Jan 19, 2004
Posts: 125
posted
0
At line if(if(selection.equals("subtract")) getting a Null Pointer Exception. Without this, form loads properly. Any ideas?