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 |
In howmany ways applet-servlet communication can be done?
Explain Servlet Chaining ?
What is meant by cookies?
What are the different types of servlets?
Can we fetch the attributes related to a servlet on a different servlet?
how can we execute servelt? what the use ".war" or ".jar" file creation
What is the life-cycle of servlets?
when the jsp page is translated to servlet?
Is java servlet still used?
What is the main purpose of java servlets?
What is the difference between ExecuteUpdate and ExecuteQuery?
Which event is fired at the time of session creation and destroy?