aspose file tools*
The moose likes Servlets and the fly likes deployment descriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "deployment descriptor" Watch "deployment descriptor" New topic
Author

deployment descriptor

Ravi Kam
Greenhorn

Joined: May 17, 2001
Posts: 3
Hello everybody.
I am facing some problem with the deployment desciptor of TOMCAT. (web.xml)
The program does not run when i add the second servlet tag to web.xml.
My application involves a login page which takes the details stores it in the database and inturn calls another form. When the details in the second form are filled and the submit button is pressed it displays driver not found.
Everything works fine when i have only one servlet (login servlet)in the application . What all changes do i need to make to add the second servlet in web.xml?? do i need to change the server.xml file.as well? please help
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
The exact requirements of the web.xml file are spelled out in the Java Servlet API which you can download from java.sun.com.
Unfortunately, that document is not real easy to read.
We would probably need to see what your current web.xml looks like to spot the problem.
Bill
------------------
author of:
Ravi Kam
Greenhorn

Joined: May 17, 2001
Posts: 3
Hi William,
Thanks for the reply.
My class files are under webapps\super\web-inf\classes dir.
The HTML files are under webapps\super directory.
The application is somewhat like this.
the login page(one.html) stores the user id and password in the database( using servlet1) and inturns calls another form . The second form (two.html)after accepting some more details from the is supposed to store the data to the database table (using servlet2)
Now the problem is...when i use the following web.xml file which uses only servlet1 . It works fine by storing the login details to the database and calls the second form.
---------------------------------------------------------------
<?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>
<welcome-file-list>
<welcome-file>superuser1.html</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>superuser</servlet-name>
<servlet-class>SuperUser</servlet-class>


<init-param>
<param-name>driver</param-name>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
</init-param>
<init-param>
<param-name>protocol</param-name>
<param-value>jdbc:Odbc:Mark </param-value>
</init-param>
</servlet>
</web-app>
-----------------------------------------------------------------
But when i try to add the second servlet (servlet2) to the classes dir and modify the web.xml by adding another servlet tag just below the original one it doesn't work.
It just calls the login page and accepts the details.When the submit button is pressed it says "DRIVER NOT FOUND".
I tried alternate ways of modifying the web.xml but i failed.
or is it something to do with the way i have written the "ACTION"
in the HTML form

Ravi Kam
Greenhorn

Joined: May 17, 2001
Posts: 3
Hi William,
Thanks for the reply.
My class files are under webapps\super\web-inf\classes dir.
The HTML files are under webapps\super directory.
The application is somewhat like this.
the login page(one.html) stores the user id and password in the database( using servlet1) and inturns calls another form . The second form (two.html)after accepting some more details from the is supposed to store the data to the database table (using servlet2)
Now the problem is...when i use the following web.xml file which uses only servlet1 . It works fine by storing the login details to the database and calls the second form.
---------------------------------------------------------------
<?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>
<welcome-file-list>
<welcome-file>superuser1.html</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>superuser</servlet-name>
<servlet-class>SuperUser</servlet-class>


<init-param>
<param-name>driver</param-name>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
</init-param>
<init-param>
<param-name>protocol</param-name>
<param-value>jdbc:Odbc:Mark </param-value>
</init-param>
</servlet>
</web-app>
-----------------------------------------------------------------
But when i try to add the second servlet (servlet2) to the classes dir and modify the web.xml by adding another servlet tag just below the original one it doesn't work.
It just calls the login page and accepts the details.When the submit button is pressed it says "DRIVER NOT FOUND".
I tried alternate ways of modifying the web.xml but i failed.
or is it something to do with the way i have written the "ACTION"
in the HTML form

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deployment descriptor