Tomcat 5 runs what Tomcat 4 doesn't after modifying WEB.XML

V

vunet.us

Hi,
WEB.XML file was modified by adding something like:

<servlet>
<servlet-name></servlet-name>
<servlet-class></servlet-class>
<load-on-startup></load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name></servlet-name>
<url-pattern></url-pattern>
</servlet-mapping>

Since this modification, my application stopped running on Tomcat 4
but runs well on Tomcat 5. Where can the problem be? I am not an
expert in Tomcat management, but can you point me out to a possible
reason? Is it possibly the declaration as:

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
 
W

Wojtek

Hi,
WEB.XML file was modified by adding something like:

<servlet>
<servlet-name></servlet-name>
<servlet-class></servlet-class>
<load-on-startup></load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name></servlet-name>
<url-pattern></url-pattern>
</servlet-mapping>

Since this modification, my application stopped running on Tomcat 4
but runs well on Tomcat 5. Where can the problem be? I am not an
expert in Tomcat management, but can you point me out to a possible
reason? Is it possibly the declaration as:

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

Well an empty url mapping probably matches everything. Since every
other setting is also empty, there is nothing for TomCat 4 to map to.

TomCat 5 probably ignores the empty mapping, with possibly an error
message in the logs.

Why would you want an empty mapping?
 
V

vunet.us

(e-mail address removed) wrote :





Well an empty url mapping probably matches everything. Since every
other setting is also empty, there is nothing for TomCat 4 to map to.

TomCat 5 probably ignores the empty mapping, with possibly an error
message in the logs.

Why would you want an empty mapping?

it's not empty, I just did not specify servlet name. do you need to
see stuff in there?
 
W

Wojtek

it's not empty, I just did not specify servlet name. do you need to
see stuff in there?

You did not specify ANYTHING. It is all empty. Every setting.

The mapping goes as follows:
- a url. This is what the browser sends to the server
- Tomcat finds the url in its list
- Tomcat matches the <servlet-name> parameters between the
<servlet-mapping> and <servlet>
- Tomcat either instantiates the <servlet-class> or finds it in its
cache.

So if there is nothing there, then Tomcat cannot possibly run anything.
 
V

vunet.us

(e-mail address removed) wrote :





You did not specify ANYTHING. It is all empty. Every setting.

The mapping goes as follows:
- a url. This is what the browser sends to the server
- Tomcat finds the url in its list
- Tomcat matches the <servlet-name> parameters between the
<servlet-mapping> and <servlet>
- Tomcat either instantiates the <servlet-class> or finds it in its
cache.

So if there is nothing there, then Tomcat cannot possibly run anything.
if you wish:
<!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>myServlet</servlet-name>
<servlet-class>direct.myServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/servlet/direct.myServlet</url-pattern>
</servlet-mapping>
.........
</web-app>
 
L

Lew

if you wish:
> (finally provides necessary information)

Don't act like you're doing him a huge favor. You asked for help, but the
information you originally gave was not accurate. How can you expect accurate
information when you don't provide accurate information? It's yourself for
whom you do the favor; it's if /you/ wish for good answers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top