• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deployment descriptor

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic