How to debug a servlet?
Answers were Sorted based on User's Feedback
Answer / madhusudhakar
res.setContentType("text/html");
ServletOutputStream out = res.getOutputStream();
try {
// do your thing here
...
}
catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
out.println("
");
out.print(sw.toString());
out.println("
");
}
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the procedure for initializing a servlet?
how JSP can extend servlet or interface ...?
Which interface must be implemented by all servlets?
What is session?
What are some disadvantages of storing session state in cookies?
What is servlet and how it works?
What do you mean by deployment descriptor?
What are the uses of servlet
Why doesn’t a servlet include main()?
What do you mean by session tracking and also explain its techniques?
How forward () method is different from send redirect () method?
What is ServletContext() and what is its use?
9 Answers Prime Technology, TCS,