Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6810643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:13:50+00:00 2026-05-26T20:13:50+00:00

I have set my error page like this in web.xml: <error-page> <exception-type>java.lang.Exception</exception-type> <location>/errors/error.jsp</location> </error-page>

  • 0

I have set my error page like this in web.xml:

 <error-page>
  <exception-type>java.lang.Exception</exception-type>
  <location>/errors/error.jsp</location>
 </error-page>

Now I would like to print stack trace of error on JSP (of course in development mode only). How can I print stack trace of error on my JSP page? I don’t use any frameworks for this application, so only default servlet APIs are available for my program.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:13:51+00:00Added an answer on May 26, 2026 at 8:13 pm

    get the parameter from request that is set internally and use it to print and deal with other information like cause, message

    <c:set var="exception" value="${requestScope['javax.servlet.error.exception']}"/>
    

    and to print stacktrace

    <!-- Stack trace -->
    <jsp:scriptlet>
      exception.printStackTrace(new java.io.PrintWriter(out));
    </jsp:scriptlet>
    

    See Also

    • JSPIntro4 – Handling Errors
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom error page set up for my application: <customErrors mode=On defaultRedirect=~/errors/GeneralError.aspx
I have a php web page that now uses custom error pages when a
I have this in my Page setup; <%@ Page Title= Language=C# MasterPageFile=~/Views/Shared/Site.Master Inherits=System.Web.Mvc.ViewPage<ILocationsFormViewModel> %>
I have a simple ASP.NET Web User Control. It looks like this: <%@ Control
I have a python script that analyzes a set of error messages and checks
For example I have site http://localhost/site In IIS I set that 404 error causes
I have been getting an error in VB .Net object reference not set to
I have a Java servlet running on my notebook with Windows Vista, I set
I have a strongly typed viewpage that I created that looks like this: <%@
I have the following in my web.config <httpErrors errorMode="Custom"> <remove statusCode="500" subStatusCode="-1" /> <error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.