Question :How can I get to print the stacktrace for an exception occuring within my
JSP page? (JSP)
Answer :By printing out the exception's stack trace, you can usually diagonse a
problem better when debugging JSP pages. By looking at a stack trace, a
programmer should be able to discern which method threw the exception
and which method called that method. However, you cannot print the
stacktrace using the JSP out implicit variable, which is of type JspWriter.
You will have to use a PrintWriter object instead. The following snippet
demonstrates how you can print a stacktrace from within a JSP error page:
<%@ page isErrorPage="true" %>
<%
out.println("
");
PrintWriter pw = response.getWriter();
exception.printStackTrace(pw);
out.println("
");
%>
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Saturday, March 14, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment