http://oreilly.com/java/archive/tomcat.html
Some control files...
/etc/tomcat7/Catalina/localhost/examples.xml
/usr/share/tomcat7-examples/examples/WEB-INF/web.xml
url-pattern will map to servlet-name
http://cs.calstatela.edu/~abbott/Courses/CS_320b/Running%20a%20Servlet%20under%20Tomcat.html
Run a Servlet
- One of the links in the file http://localhost:8080/examples/servlets/index.html is to
../servlet/HelloWorldExample
. On first glance, this looks like it should be referring to a file at . But there is no such file. In fact, there is no such directory as%TOMCAT_HOME%/webapps/examples/servlet/HelloWorldExample
.%TOMCAT_HOME%/webapps/examples/servlet/
- Instead, by convention, a reference to what appears to be a
servlet
directory at the top level of a mapped webapp address means: execute the indicated servlet. In this case, execute the servlet calledHelloWorldExample
. - Servlets are simply
.class
files, i.e., compiled.java
files. - Servlet files are stored in the
subdirectory of the main web application directory. In this case theWEB-INF/classes
.class
files for theexamples
web app is stored in .%TOMCAT_HOME%/webapps/examples/WEB-INF/classes
http://localhost:8080/examples/servlet/HelloWorldExampleTomcat runs
%TOMCAT_HOME%/webapps/examples/WEB-INF/classes/HelloWorldExample.class
No comments:
Post a Comment