Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat WEB.XML problem

 
nirail rail
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
nirail rail
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry

it is located in com.sec.server and not com.sec.server.loginDirect
loginDirect.class is the name of servlet class
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which URL are you trying to access?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic