|
How are you using tomcat? Standalone or with Apache
+ mod_jk?
There is a little difference.
----- Original Message -----
Sent: Wednesday, December 13, 2000 3:42
PM
Subject: Servlet Mappings and what am I
doing wrong.
I have some legacy code that uses its own non-jsp
tag system.
The following is my web.xml file put in
webapps/myapp/WEB-INF dir
The attempt is to map files with the
extension *.msp to the RouterServlet. Unfortunately this is
not happening, if I goto the directory and do an msp file it lists it as
text. I then tried to do the same with the entire directory (hence
the second mapping).
What else do I need? What am I doing
wrong? (This used to use JServ ApJServAction but I'm attempting
to move to Tomcat3.2 and the new connector) and migrate toward a
standard system.
Please note I've genericised all filenames/ips
in this. If there is a site called myorg.com, I'm not affilliated
with it. I was trying to be
generic.
Thanks,
-Andy
<?xml version="1.0"
encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<servlet>
<servlet-name>
RouterServlet
</servlet-name>
<servlet-class>
com.myorg.servlet.RouterServlet
</servlet-class>
<init-param>
<param-name>handlers_classpath</param-name>
<param-value>com.myorg.servlet</param-value>
</init-param>
<init-param>
<param-name>handlers</param-name>
<param-value> Article,Index,Default,Previous,Image,SendFriend,Poll</param-value>
</init-param>
<init-param>
<param-name>pools</param-name>
<param-value>pools</param-value>
</init-param>
<init-param>
<param-name>pool_url</param-name>
<param-value>jdbc:oracle:thin:@192.168.1.2:1521:MYDB</param-value>
</init-param>
<init-param>
<param-name>pool_max_conn</param-name>
<param-value>20</param-value>
</init-param>
<init-param>
<param-name>pool_max_checkout</param-name>
<param-value>10</param-value>
</init-param>
<init-param>
<param-name>realfiledir</param-name>
<param-value>/usr/local/apache/virtual/myorg.com/htdocs</param-value>
</init-param>
<init-param>
<param-name>thread</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>thread_interval</param-name>
<param-value>300</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>
RouterServlet
</servlet-name>
<url-pattern>
/myorg.com/*
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
RouterServlet
</servlet-name>
<url-pattern>
/myorg.com/*.msp
</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>
http://java.apache.org/tomcat/examples-taglib
</taglib-uri>
<taglib-location>
/WEB-INF/jsp/example-taglib.tld
</taglib-location>
<taglib>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected
-->
<url-pattern>/jsp/security/protected/*</url-pattern>
<!-- If you list http methods, only those methods are protected
-->
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area
-->
<role-name>tomcat</role-name>
<role-name>role1</role-name>
</auth-constraint>
</security-constraint>
<!-- Default login
configuration uses BASIC authentication -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Example Basic
Authentication Area</realm-name>
</login-config>
<!-- If you want to
experiment with form-based logins,
comment out the
<login-config> element above and replace it
with this one. Note
that we are currently using
a nonstandard
authentication method, because the code to support
form based login is
incomplete and only lightly tested. -->
<!--
<login-config>
<auth-method>EXPERIMENTAL_FORM</auth-method>
<realm-name>Example Form-Based
Authentication Area</realm-name>
<form-login-config>
<form-login-page>/jsp/security/login/login.jsp</form-login-page>
<form-error-page>/jsp/security/login/error.jsp</form-error-page>
</form-login-config>
</login-config>
-->
</web-app>
__________________________________________________ Do
You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of
Products. http://shopping.yahoo.com/
|