tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tomcat Wiki] Update of "FAQ/Miscellaneous" by KonstantinKolinko
Date Sun, 28 Mar 2010 15:16:48 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification.

The "FAQ/Miscellaneous" page has been changed by KonstantinKolinko.
The comment on this change is: Added a link to the tag pooling section, moved tag pooling
FAQ items to be together. Added space between answers..
http://wiki.apache.org/tomcat/FAQ/Miscellaneous?action=diff&rev1=18&rev2=19

--------------------------------------------------

   1. [[#Q6|How do I get a customized error page?]]
   1. [[#Q7|Should I use the LE version?]]
   1. [[#Q8|How do I configure Tomcat to NOT to store the sessions during shutdown?]]
-  1. [[#Q9|How do I disable tag pooling?]]
   1. [[#Q10|Is there a DTD for server.xml?]]
   1. [[#Q11|How do I change the welcome file? ( I want to show index.jsp instead of index.html)]]
   1. [[#Q12|How do I enable/disable directory listings?]]
   1. [[#Q13|How do I use symbolic links with jars?]]
   1. [[#Q14|How do I change the name of the file in the download Save-As dialog from a servlet?
(or jsp)]]
   1. [[#Q15|Is tag pooling broken? It doesn't call release!]]
+  1. [[#Q9|How do I disable tag pooling?]]
   1. [[#Q16|Why do I get java.lang.IllegalStateException ?]]
   1. [[#Q17|How do I make a scheduled event on Tomcat?]]
   1. [[#Q18|What is Element "web-app" does not allow "servlet" here?]]
@@ -34, +34 @@

   1. [[#Q28|What's the different between a Valve and Filter?]]
  
  == Answers ==
+ 
  <<Anchor(Q1)>>'''I am unable to compile my JSP!'''
  
  Are you seeing this?
@@ -60, +61 @@

  
  In the case of the Environment issues, it is typical that on Windows, the startup scripts
work fine and the service does not. The service uses registry values to look for java and
other "stuff". To save yourself some trouble, see if the [[http://web.bvu.edu/staff/david/tcservcfg/|NT
Service Config Utility]] is helpful.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q2)>>'''I can't get servlets to work under /servlet/*!'''
  
  Using /servlet/ to map servlets is evil, absolutely evil. Even more evil than [[http://www.eviloverlord.com/lists/overlord.html|this]]
. That being said, here are some threads that may answer this:
@@ -67, +71 @@

   * [[http://marc.theaimsgroup.com/?l=tomcat-user&m=103417249925541&w=2|(SECURITY)
Apache Tomcat 4.x JSP source disclosure]] vulnerability
   * [[http://marc.theaimsgroup.com/?t=103945337100003&r=1&w=2|Cannot Run Servlets,
only JSP's, Part II]]
   * [[http://marc.theaimsgroup.com/?t=104326854100001&r=1&w=2|Tomcat configuration
problem: JSPs work, servlets don]]
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q3)>>'''Why is the invoker evil?'''
  
@@ -84, +91 @@

  
  For another explanation of the invoker servlet, why it's evil, and what to do about it,
see [[http://test.javaranch.com/wiki/view?InvokerServlet|JavaRanch FAQ]].
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q4)>>'''How to I get Tomcat's version number?'''
  
  {{{javax.servlet.ServletContext.getServerInfo();}}}
  
  Starting with tomcat 5.0.28 - there is now a version.sh (or version.bat) program in the
bin directory. It will print the version number of tomcat to Standard output.
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q5)>>'''Tomcat eats 100% of the CPU!'''
  
@@ -104, +117 @@

  Example (UNIX): {{{export JAVA_OPTS='-DpropName=propValue' }}}
  
  Windows service users - use [[http://web.bvu.edu/staff/david/tcservcfg/|this]]
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q6)>>'''How do I get a customized error page?'''
  
@@ -119, +135 @@

  You may also catch error 500's as well as other specific exceptions or exceptions which
extend Throwable.
  For more information, see the Servlet Specification for all the gory details of how you
can play with this.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q7)>>'''Should I use the LE version?'''
  
  No. It was an experiment, it failed. (YMMV) The original purpose of LE "light" edition of
Tomcat 4.0, 4.1 was because jdk1.4 provides a LOT of standard functionality that Tomcat uses
that was not in jdk1.3. So to save some space two distributions were made to save some bandwidth.
Since then, it has been an exercise in confusion. (Flame me if you disagree) [[http://marc.theaimsgroup.com/?l=tomcat-user&m=105341005928071&w=2|More
info]]
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q8)>>'''How do I configure Tomcat to NOT to store the sessions during
shutdown?'''
  
  [[http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html|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(Q9)>>'''How do I disable tag pooling?'''
  
+ <<BR>>
- 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 [[http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html|JspServlet]],
affects code generation and compilation of JSP pages. It will not alter the behavior of JSPs
that have already been compiled.
  
  <<Anchor(Q10)>>'''Is there a DTD for server.xml?'''
  
  No! Nor can one accurately exist. [[http://marc.theaimsgroup.com/?l=tomcat-user&m=104205666221372&w=2|Here's
why]]
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q11)>>'''How do I 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. [[http://marc.theaimsgroup.com/?l=tomcat-user&m=104566785828794&w=2|More
detail]].
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q12)>>'''How do I enable/disable directory listings?'''
  
@@ -169, +194 @@

  
  }}}
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q13)>>'''How do I use symbolic links with jars?'''
  
- You'll need to tweak with server.xml and [[http://marc.theaimsgroup.com/?l=tomcat-user&m=105159411609623&w=2|do
this]]. (Don't worry - its really easy!)
+ You'll need to tweak with server.xml and [[http://marc.theaimsgroup.com/?l=tomcat-user&m=105159411609623&w=2|do
this]]. (Don't worry - its really easy!) Update: you should be worried -- this feature has
its drawbacks.
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q14)>>'''How do I change the name of the file in the download Save-As
dialog from a servlet? (or jsp)'''
  
  Use the [[http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html|Content-Disposition]]
header.
  
+ 
+ <<BR>>
+ 
  <<Anchor(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. [[https://issues.apache.org/bugzilla/show_bug.cgi?id=16001|Bug
16001]] has all the gory details.
+ It is not broken, your tag probably is. Many bug reports have been filed about this. [[https://issues.apache.org/bugzilla/show_bug.cgi?id=16001|Bug
16001]] has all the gory details. There is also a nice [[http://tomcat.apache.org/taglibs/site/guidelines.html|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.
+ 
+ 
+ <<BR>>
+ 
+ <<Anchor(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 [[http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html|JspServlet]],
affects code generation and compilation of JSP pages. It will not alter the behavior of JSPs
that have already been compiled.
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q16)>>'''Why do I get {{{java.lang.IllegalStateException}}} ?'''
  
@@ -208, +256 @@

  }
  }}}    
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q17)>>'''How do I make a scheduled event on Tomcat?'''
  
  Tomcat does not support this directly. Its not part of the Servlet or JSP Specification.
  If you do need this functionality see [[http://marc.theaimsgroup.com/?t=106192918700004&r=1&w=2|this
thread]] or [[http://marc.theaimsgroup.com/?l=tomcat-user&m=106157051231075&w=2|this
link]].
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q18)>>'''What is Element "web-app" does not allow "servlet" here?'''
  
  Your web.xml is not well formed or it is not conforming to the DTD as defined by the servlet
spec. Use an XML validator to ensure your web.xml file is ok.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q19)>>''' How do open a file for reading in my webapp?'''
  
  Use {{{ServletContext.getResourceAsStream()}}}
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q20)>>'''Can I run tomcat with the JRE, or do I need the full JDK?'''
  
  Tomcat 4 requires the full JDK. Tomcat 5.5 onwards will work with a JRE or a JDK.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q21)>>'''Is tomcat an EJB server? Can I use EJBs with tomcat?'''
  
  Tomcat is not an EJB server. Tomcat is not a full J2EE server. Tomcat is a Servlet container.
Tomcat does support those parts of the J2EE specification that are required for Servlets,
such as a subset of JNDI functionality. Furthermore, you can connect to remote J2EE servers,
or run tomcat embedded inside a full J2EE server.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q22)>>'''Can I access Tomcat's JNDI provider from outside tomcat?'''
  
  Not at this time.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q23)>>'''Who uses tomcat in production?'''
  
  Numerous organizations across various industries all over the world. A full listing can
be found at the [[http://wiki.apache.org/tomcat/PoweredBy|Wiki]].
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q24)>>'''I'm getting {{{java.lang.ThreadDeath}}} exceptions when reloading
my webapp.'''
  
  See [[http://issues.apache.org/bugzilla/show_bug.cgi?id=26372|Bugzilla discussion]] of this.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q25)>>'''Help! Even though I run shutdown.sh (or shutdown.bat), Tomcat
does not stop!'''
  
  Most likely, a non-daemon thread is running. JVM's do not shutdown until there are 0 non-daemon
threads. You will need to perform a thread dump [kill -3 pid for Unix or CTRL+Break for Windows]
to determine the code which started the thread.
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q26)>>'''How do I debug JSP errors in the Admin web application?'''
  
@@ -257, +335 @@

   6. If you haven't already, define an admin user in %CATALINA_HOME%\conf\tomcat-users.xml.
   7. Start Tomcat, navigate to http://localhost:8080 (or your actual server:port if you have
modified the default values), and access the admin web application. It will run slower because
Tomcat is now compiling the JSPs on-demand the first time you access them, but should otherwise
appear normal.
  
+ 
+ <<BR>>
+ 
  <<Anchor(Q27)>>'''What order do webapps start (or how can I change startup order)?'''
  
  There is no expected startup order. Neither the Servlet spec nor Tomcat define one. You
can't rely on the apps starting in any particular order. 
+ 
+ 
+ <<BR>>
  
  <<Anchor(Q28)>>'''What's the different between a Valve and Filter?'''
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message