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 |
Whether we can get deadlock situation in servlets?
Who is responsible for writing a constructor?
What is a web application and what is it’s directory structure?
how many jsp scripting elements are there and what are those?
can servlet have instance variables?
What is called Session Tracking?
Name the servers that can be used to develope and deploy Servlets?
How we can get ip address of client in servlet?
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
What is the difference between an applet and a servlet?
15 Answers GCEW, Miracle Solutions,
What are the jobs performed by servlets?
What is called servlet container?