How to debug a servlet?

Answers were Sorted based on User's Feedback



How to debug a servlet?..

Answer / niranjanravi

through servletloginfo()

Is This Answer Correct ?    2 Yes 1 No

How to debug a servlet?..

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

Post New Answer

More Servlets Interview Questions

What are the security issues in Servlets?

2 Answers  


can we override service method in my servlet class..?? if yes or no why ??

7 Answers   IBM,


Is Servlet Class Thread safe?????? How to make servlet Thread safe ???

4 Answers   Cognizant,


what is the difference between Servlet and JSP?Advantage of JSP over Servelt?Any concept present in JSP which we cant implement in Servlet?

31 Answers   ABC, Apere, AZTEC, CTS, CybAge, iFlex, Impact Systems, Sara, TCS,


List out the difference between ServletConfig and ServletContext?

0 Answers  






Why do we need servlet filter?

0 Answers  


How servlet is created?

0 Answers  


Explain request dispatcher and its methods.

0 Answers  


What is servlet looping or chaining?

0 Answers  


what is the difference b/w DispatchAction and LookUpDispatchAction?

1 Answers   Deloitte, iGate, Tech Mahindra,


What is meant by Servlet? What are the parameters of service method?

0 Answers  


What are the benefits of using servlet over cgi?

0 Answers  


Categories