Hello,

I am a Tomcat newbie and I am trying to find an answer to this one by
looking at past postings and by RTFM, but am having little luck.

Platform: Win 2000 SP2
Web Server: Apache 1.3.24
Tomcat version: 4.0.3
JDK: 1.4.0

We have a servlet we have run successfully on JServ (Win32, Linux, Solaris),
Netcape Enterprise Server (Win32, Solaris) and JRun (Win32) and now wish to
migrate over Tomcat.  The servlet is a redirector that hands an http request
to another Java application.  The value *.class always must appear in the
URL.  But there are almost always additional arguments following it.

I have included what I think to be the relevant pieces of my httpd.conf

ServerName localhost

<IfModule mod_webapp.c>
WebAppConnection conn      warp  localhost:8008
WebAppDeploy     reDirector  conn  /Foo/Bar
</IfModule>

Tomcat seems to have installed correctly, all the example servlets work.

I add a context to my server.xml

<Context path="/Foo/Bar" docBase="reDirector" debug="1" reloadable="true"
crossContext="true" />

I created a web.xml that works just fine when one wishes to run the servlet
with no arguments (a test mode to see if is working) and that the docBase
seems to be configured correctly.


<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd";>

<web-app>
  <servlet>
    <servlet-name>Foo_Bar</servlet-name>
    <servlet-class>reDirector</servlet-class>
    <init-param>
      <param-name>redirconfig</param-name>
      <param-value>c:\mypath\config.ini</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
      <servlet-name>Foo_Bar</servlet-name>
      <url-pattern>/*</url-pattern>
  </servlet-mapping>
  </web-app>


I have deduced (maybe incorrectly) that the problems I am having come down
to correctly setting <url-pattern></url-pattern> entry of my web.xml
correctly.  I get a variety of response based upon that value.

Below are the results base different url-pattern(s)

1) <url-pattern>/*</url-pattern>

This actually produces the desired result.  The URL called was:

//Foo/Bar/Myapplication.class?FNC=start__Ahome_html

The following line details the form submission for the login:

<form ACTION="/Foo/Bar/Myapplication.class" METHOD="post" name="LoginForm">

The expected value is returned to the browser (a login screen).

/Foo/Bar/Myapplication.class?FNC=SelectStuff__Ahome_html___

However, after attempting to login get the following Apache error:

Not Found
The requested URL /Myapplication.class was not found on this server.

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

Apache/1.3.24 Server at localhost Port 80


The URL called by the form submission was:

/Foo/Bar/Myapplication.class?FNC=SelectStuff__Ahome_html___

(as detailed in '<form ACTION="/Foo/Bar/Myapplication.class" METHOD="post"
name="LoginForm">')

In this case it seems like the Apache is not handing off aliased URL
/Foo/Bar to Tomcat when it is embedded in a form submission.


2) <url-pattern>/Foo/Bar/*</url-pattern>

Reading in the Java Servlet Specification Version 2.3 this actually seems
like a more correct version than above.  However instead of initially
getting the login screen I get the following Tomcat error message:


Apache Tomcat/4.0.3 - HTTP Status 404 - /Foo/Bar/Myapplication.class

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

type Status report

message /Foo/Bar/Myapplication.class

description The requested resource (/Foo/Bar/Myapplication.class) is not
available.

Again the URL called by the form submission was:

/Foo/Bar/Myapplication.class?FNC=SelectStuff__Ahome_html___

(as detailed in '<form ACTION="/Foo/Bar/Myapplication.class" METHOD="post"
name="LoginForm">')

In this case the alias /Foo/Bar is being handed off to Tomcat but Tomcat
doesn't know to hand it off to the reDirector servlet.


I have tried other url-pattern(s) but the the result has always been the
Tomcat 404 error.

Any help on this would be greatly appreciated.

Thanks in Advance,

Dave Christian


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to