aspose file tools*
The moose likes Tomcat and the fly likes Tomcat WEB.XML problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat WEB.XML problem" Watch "Tomcat WEB.XML problem" New topic
Author

Tomcat WEB.XML problem

nirail rail
Ranch Hand

Joined: Nov 14, 2003
Posts: 39
hi all

i am trying to run a servlet using tomcat

my web.xml is
<servlet>
<servlet-name>loginDirect</servlet-name>
<servlet-class>com.sec.server.loginDirect</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>loginDirect</servlet-name>
<url-pattern>/loginDirect</url-pattern>
</servlet-mapping>
<!-- Session Configuration -->
<session-config>
<session-timeout>60</session-timeout>
</session-config>


it is locatted in directory
nmr
WEB-INF
classes
com.sec.server.loginDirect

when i am trying to make a call to servlet using JSP

<form name="userForm" ENCTYPE="text/html" method="post" action="/loginDirect">

its giving me an error 404

pls help
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
it is locatted in directory
nmr
WEB-INF
classes
com.sec.server.loginDirect


If the class is named loginDirect, it needs to be in the directory ../com/sec/server, not ...com/sec/server/loginDirect.

Are there any error messages in the log files, during startup or later?


Ping & DNS - my free Android networking tools app
nirail rail
Ranch Hand

Joined: Nov 14, 2003
Posts: 39
sorry

it is located in com.sec.server and not com.sec.server.loginDirect
loginDirect.class is the name of servlet class
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Which URL are you trying to access?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410



Either remove the leading slash from your action attribute and make it fully relative or qualify it with the context path.



Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat WEB.XML problem