Your code should work. If nothing is printed, not even "null", then you probably aren't getting to your servlet at all. If you set a break point in the servlet, is it hit? If not, your web.xml URL mapping may be wrong. (Or some other mapping file, if you're using something like Struts.)
What do you mean when you say "printed"? In most cases, System.out.println() in a servlet will write to a log file somewhere in the servlet container. Did you expect "A" to show up in the generated HTML? Or what?
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
posted
0
Use
if you want to return text to the client.
JDBCSupport - An easy to use, light-weight JDBC framework -
gayatri umesh
Greenhorn
Joined: Aug 26, 2009
Posts: 17
posted
0
When i run the jsp, and click the link 'A', it goes to the ProductController servlet....but nothing is displayed....
gayatri umesh
Greenhorn
Joined: Aug 26, 2009
Posts: 17
posted
0
i gave System.out.println() and the output prints in the console..I am using RAD..I tried displaying the value using PrintWriter object also....
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
posted
0
Try to see what parameters come in.
First output a hard coded literal to see if the servlet gets executed.
Then do Enumeration<String> params = request.getParameterNames();
iterate over that Enumeration and see what comes up.