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
Is servlet thread safe?
What is the directory structure of a war file?
How can we achieve transport layer security for our web application?
How to get the IP address of client in servlet?
What is servlet interface?
What is the difference between CGI and Servlet?
What is the difference between Difference between doGet() and doPost()?
What is ServletContext object?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
Explain the war file?
What do you mean by singlethreadmodel interface?
Explain the servlet context.
Is dispatcher servlet a singleton?
Can you explain in detail 'javax.servlet' package?
What is preinitialization of a servlet?