Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added a link to the tag pooling section, moved tag pooling FAQ items to be together. Added space between answers.

...

  1. I am unable to compile my JSP!
  2. I can't get servlets to work under /servlet/*!
  3. Why is the invoker evil?
  4. How to I get Tomcat's version number?
  5. Tomcat eats 100% of the CPU!
  6. How do I get a customized error page?
  7. Should I use the LE version?
  8. How do I configure Tomcat to NOT to store the sessions during shutdown?
  9. How do I disable tag pooling?
  10. Is there a DTD for server.xml?
  11. How do I change the welcome file? ( I want to show index.jsp instead of index.html)
  12. How do I enable/disable directory listings?
  13. How do I use symbolic links with jars?
  14. How do I change the name of the file in the download Save-As dialog from a servlet? (or jsp)
  15. Is tag pooling broken? It doesn't call release!
  16. How do I disable tag pooling?
  17. Why do I get java.lang.IllegalStateException ?
  18. How do I make a scheduled event on Tomcat?
  19. What is Element "web-app" does not allow "servlet" here?
  20. How do I open a file for reading in my webapp?
  21. Can I run tomcat with the JRE, or do I need the full JDK?
  22. Is tomcat an EJB server? Can I use EJBs with tomcat?
  23. Can I access Tomcat's JNDI provider from outside tomcat?
  24. Who uses tomcat in production?
  25. I'm getting java.lang.ThreadDeath exceptions when reloading my webapp.
  26. Help! Even though I run shutdown.sh (or shutdown.bat), Tomcat does not stop!
  27. How do I debug JSP errors in the Admin web application?
  28. What order do webapps start (or How can I change startup order)?
  29. What's the different between a Valve and Filter?

...

Look at the Session manager component and tweak accordingly. One way is to tell tomcat to persist sessions to a path which does not exist. (So tomcat will not store, or be able to load the sessions)

Anchor
Q10
Q10
Is there a DTD for server.xml?

No! Nor can one accurately exist. Here's why

Anchor
Q9Q11Q9
Q11
How do I disable tag pooling?

To disable tag pooling: See $TOMCAT_HOME/conf/web.xml --> enablePooling=false for the jsp servlet declaration.

Note: This option, as well as most other configuration options of JspServlet, affects code generation and compilation of JSP pages. It will not alter the behavior of JSPs that have already been compiled.

...

change the welcome file? ( I want to show index.jsp instead of index.html)

This is done in web.xml by changing welcome-files-list. More detail.

Anchor
Q12
Q12
How do I enable/disable directory listings?

To make a global change, this is done in TOMCAT_HOME/conf/web.xml by changing the listings property for the default servlet.

If you want to enable it for an individual webapp, then you need to add something similar to the following to your web.xml file (for your individual app):

No Format

   <servlet>
       <servlet-name>listing</servlet-name>
       <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
       <init-param>
           <param-name>debug</param-name>
           <param-value>0</param-value>
       </init-param>
       <init-param>
    

No! Nor can one accurately exist. Here's why

...

This is done in web.xml by changing welcome-files-list. More detail.

...

To make a global change, this is done in TOMCAT_HOME/conf/web.xml by changing the listings property for the default servlet.

If you want to enable it for an individual webapp, then you need to add something similar to the following to your web.xml file (for your individual app):

No Format

   <servlet>
       <servlet<param-name>listing<name>listings</servletparam-name>
       <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>    <param-value>true</param-value>
       <init</init-param>
       <load-on-startup>1</load-on-startup>
    <param-name>debug</param-name></servlet>

   <servlet-mapping>
        <param<servlet-value>0<name>listing</paramservlet-value>name>
       </init-param><url-pattern>/</url-pattern>
       <init-param>
           <param-name>listings</param-name>
           <param-value>true</param-value>
       </init-param>
       <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
       <servlet-name>listing</servlet-name>
       <url-pattern>/</url-pattern>
   </servlet-mapping>

...

You'll need to tweak with server.xml and do this. (Don't worry - its really easy!)

...

</servlet-mapping>

Anchor
Q13
Q13
How do I use symbolic links with jars?

You'll need to tweak with server.xml and do this. (Don't worry - its really easy!) Update: you should be worried – this feature has its drawbacks.

Anchor
Q14
Q14
How do I change the name of the file in the download Save-As dialog from a servlet? (or jsp)

Use the Content-Disposition header.

Anchor
Q15
Q15
Is tag pooling broken? It doesn't call release!

It is not broken, your tag probably is. Many bug reports have been filed about this. Bug 16001 has all the gory details. There is also a nice description of the life cycle.

Note, that this issue does not affect the SimpleTag tags and tag files of JSP 2.0 and later specifications, because those do not use tag pooling.

Anchor
Q9
Q9
How do I disable tag pooling?

To disable tag pooling: See $TOMCAT_HOME/conf/web.xml --> enablePooling=false for the jsp servlet declaration.

Note: This option, as well as most other configuration options of JspServlet, affects code generation and compilation of JSP pages. It will not alter the behavior of JSPs that have already been compiled

Use the Content-Disposition header.

AnchorQ15Q15Is tag pooling broken? It doesn't call release!It is not broken, your tag probably is. Many bug reports have been filed about this. Bug 16001 has all the gory details.

Anchor
Q16
Q16
Why do I get java.lang.IllegalStateException ?

...