• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

incorrect web.xml doesn't complain

 
Shreyas Reddy
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have the following web.xml which runs fine without complaining in weblogic 7.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>
<servlet>
<servlet-name>so</servlet-name>
<servlet-class>wcde.SO</servlet-class>
<load-on-startup>2</load-on-startup> <!-- this is supposed to be after init param elment -->
<init-param>
<description>tt</description>
<param-name>name</param-name>
<param-value>value</param-value>
</init-param>

</servlet>

<servlet-mapping>
<servlet-name>so</servlet-name>
<url-pattern>/so</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>1</session-timeout> <!-- the container doen't complain if I have an alphabet S instead of 1 -->
</session-config>
<welcome-file-list>
<welcome-file>hello.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>
http://www.mycompany.com/taglib
</taglib-uri>
<taglib-location>
/WEB-INF/taglib.tld
</taglib-location>
</taglib>
<security-constraint>
<web-resource-collection>
<web-resource-name>wcde</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>worker</role-name>
<role-name>supervisor</role-name>
<description>des</description>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>default</realm-name>
</login-config>

<security-role>
<role-name>worker</role-name>
</security-role>

<security-role>
<role-name>supervisor</role-name>
</security-role>
</web-app>
------------------------------------------------------
Also the description in init-param and auth-constraint are not in the right place and the application works fine without any problem. Can someone explain why is it so.
Thx in advance
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't help you much with your xml document, sorry. But it would be much easier to read if you enclosed it in a CODE tag, which you cna get by clicking on the CODE button underneath the first ADD REPLY button.
By using the CODE tag your indentation would remain and make it much easier to read.
Mark
[ October 17, 2003: Message edited by: Mark Spritzler ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now doesn't this look much prettier and easier to read.

Mark
[ October 17, 2003: Message edited by: Mark Spritzler ]
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
Have you checked the log files, the errors must be written in the log files.
If you dont stick to the DTD, it will surely give errors.
HTH
MB
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic