R4R
Right Place For Right Person TM

How can I print the stack trace of an exception from a JSP page?

previous previous previous
Question:
How can I print the stack trace of an exception from a JSP page?

Question:How can I print the stack trace of an exception from a JSP page?


Answer
To print the stack trace of an exception from a JSP page you will have to use a PrintWriter object instead of usnig JSP out implicit variable. <% out.println("<!--"); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); exception.printStackTrace(pw); out.print(sw); sw.close(); pw.close(); out.println("-->"); %> In the above code you have import="java.io.* package.

By:Jalees
Date:

How can I print the stack trace of an exception from a JSP page?

Post Your Answers


User Name:
Answers:

Related Links

  1. Do objects stored in a HTTP Session need to be serializable? Or can it store any object?
  2. What is the differecnce between JspWriter and PrintWriter?
  3. How can you implement singleton pattern in servlets ?
  4. What is the difference between an application server and a web server?
  5. Can we implement Runnable interface from within our servlet?
  6. What is RequestPocessor class? How will you create your own RequestPocessor?
  7. Can you test a JSP page using Junit?

Question:How can I print the stack trace of an exception from a JSP page?

Back Home Next

New Updates

Topics

Topics

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R