• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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 ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic