5

I am new to Tomcat. I was referring this document which states that

The JasperListener enables the Jasper JSP engine, and is responsible for re-compiling the JSP pages that have been updated.

So then it means that if I disable JasperListener then JSP pages should fail to compile and not load or should get HTTP 5xx status code from Tomcat. So I disabled it:

<!-- <Listener className="org.apache.catalina.core.JasperListener" /> -->

But even after disabling it I am able to run JSP pages without any issues.

So what is the use of JasperListener? And also could you guys tell me what Listeners generally mean and how they are used?

1

1 Answer 1

-19

Rather the reading some random document of the internet you could try reading the actual Tomcat documentation. Better still, since Tomcat is open source, why not look at the source code?

The purpose of the JasperListener is to ensure Jasper is initialized in the context of the container class loader rather than a web application class loader to prevent memory leaks.

Generally, a listener is a piece of code that is executed when an event (e.g. message received, application started, etc) occurs.

1
  • 16
    No need to be snarky in your answer. This is a Q&A site. The point is to be able to get answers without having to do all the research yourself, especially if you would need to learn some base technology to be able to research. Commented Jul 8, 2015 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.