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 |
Can threads be used in Servelet?
What are the types of an http request?
How to generate the server side programming and the advantages of it over the other languages?
What do you mean by session tracking and also explain its techniques?
How do you define a servlet?
Is servlet a server side scripting language?
What is the difference between CGI and Servlet?
What is servlet initializer?
How do you configure a centralized error handler in servlets?
Can you send an authentication error from a servlet?
Is there any need to shutdown the web server, if you want to modify a servlet?
what is OOAS