• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to read value of <a> tag in servlet

 
gayatri umesh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In servlet, i gave this

Nothing is printed....kindly help......
 
Max Rahder
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Paul Clapham
Sheriff
Posts: 21117
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use



if you want to return text to the client.
 
gayatri umesh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i run the jsp, and click the link 'A', it goes to the ProductController servlet....but nothing is displayed....
 
gayatri umesh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Shruthi Sam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
Its working for me... check once again

Here is the code i tried...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic