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 |
How can we include static files in the jsp page?
What is called servlet container?
How can we invoke another servlet in a different application?
What is getservletcontext?
What are setComment and getComment methods in Cookies?
What is called Session Tracking?
waht is the main diference b/w servelts and JSP ?
Define context initialization parameters.
What is URL Rewriting ?
where the session data will stored?
how to make the IP address to .com
Explain the steps involved in placing a servlet within a package?