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 do you mean by servlet context?
If my browser does not support cookie, and my server sends a cookie instance what will happen?
What is servlet container. how it works?
How to work with Chinese login page (internationalization).if he enters user name and password in chinese, how is it converted to English and validate in db? And in reverse it should display welcome message in Chinese,if user is valid
Explain the different ways for servlet authentication?
What is the directory structure of web application?
what happens if we wont use destroy()?
What is servlet? Explain
What are the functions of Servlet container?
What is Server-Side Includes?
How do you run a servlet?
Where do you define dispatcherservlet?