Answer Posted / 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 |
Post New Answer View All Answers
What is Client-Server Computing?
What are the types of Session Tracking ?
Difference between java beans & servlets?
Is tomcat a servlet container?
What is servlet invoker?
What is java servlet?
What are sessions in servlets?
What is api in servlet?
Name the packages that work with servlet?
Explain the different ways for servlet authentication?
What's the use of servletcontext?
What is preinitialization of a servlet?
Why is http protocol called as a stateless protocol?
Is servlet a server side scripting language?
What are the supporting protocol by HttpServlet ?