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 session?
What are the two important api's in for servlets?
Which event is fired at the time of project deployment and undeployment?
what is the difference between?when we write the code in following manner? class One extends httpservlet { } and class One extends genericservlet { }
How is an application exception handling is done using a servlet?
What do you mean by web applications?
What are the objects involved when a servlet receives a call from client?
Why session tracking is needed?
Define the lifecycle for executing a jsp page.
What is http servlet?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
why are using HttpServlet in realtime projects and why are not using Genericservlet