Help coderanch get a
new server
by contributing to the fundraiser
  • 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

simple problem with web.xml

 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pals,
I find no problem in the following deployment descriptor, but my tomcat4.0.4 finds
It reports problem in /web-app/servlet. Tell me why....:rooleyes:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Test Webapp</display-name>
<description>This is an online survey system.</description>
<servlet>
<servlet-name>
sessionTracker
</servlet-name>
<jsp-file>
sessionTrack.jsp
</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>
sessionTracker
</servlet-name>
<url-pattern>
/survey/sessionTracker
</url-pattern>
</servlet-mapping>
<session-config>
<!-specifies session timeout as 25 minutes. -->
<session-timeout>25</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>
sessionTracker
</web-resource-name>
<url-pattern>
/survey/sessionTracker
</url-pattern>
<http-method>
POST
</http-method>
<auth-constraint>
<role-name>
user
<role-name>
</auth-constraint>
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>
FORM
</auth-method>
<form-login-config>
<form-login-page>
/survey/logon.jsp
</form-login-page>
<form-error-page>
/survey/error.html
</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>user</role-name>
</security-role>
<security-role>
<role-name>admin</role-name>
</security-role>
</web-app>
 
Ashik Uzzaman
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I knew the problem was simple and the solution was simpler.
The <jsp-file> element takes the relative path.
So it would be

<jsp-file>
/survey/surveyTrack.jsp
</jsp-file>

There were some minor typing mistakes also. So I am giving here the full web.xml file again.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Test Webapp</display-name>
<description>This is an online survey system.</description>
<servlet>
<servlet-name>
sessionTracker
</servlet-name>
<jsp-file>
/survey/sessionTrack.jsp
</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>
sessionTracker
</servlet-name>
<url-pattern>
/survey/sessionTracker
</url-pattern>
</servlet-mapping>
<session-config>
<!-- specifies session timeout as 25 minutes. -->
<session-timeout>25</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>
sessionTracker
</web-resource-name>
<url-pattern>
/survey/sessionTracker
</url-pattern>
<http-method>
POST
</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>
user
</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>
FORM
</auth-method>
<form-login-config>
<form-login-page>
/survey/logon.jsp
</form-login-page>
<form-error-page>
/survey/error.html
</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>user</role-name>
</security-role>
<security-role>
<role-name>admin</role-name>
</security-role>
</web-app>

[ August 05, 2002: Message edited by: Ashik uzzaman ]
 
I'd appreciate it if you pronounced my name correctly. Pinhead, with a silent "H". Petite ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic