Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to debug a servlet?

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


Please Help Members By Posting Answers For Below Questions

Is servlet thread safe?

982


What is the directory structure of a war file?

1168


How can we achieve transport layer security for our web application?

1036


How to get the IP address of client in servlet?

1083


What is servlet interface?

1219


What is the difference between CGI and Servlet?

1073


What is the difference between Difference between doGet() and doPost()?

1290


What is ServletContext object?

1095


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 ?

1080


Explain the war file?

1062


What do you mean by singlethreadmodel interface?

1041


Explain the servlet context.

1134


Is dispatcher servlet a singleton?

1007


Can you explain in detail 'javax.servlet' package?

994


What is preinitialization of a servlet?

1026