File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes incorrect web.xml doesn't complain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "incorrect web.xml doesn Watch "incorrect web.xml doesn New topic
Author

incorrect web.xml doesn't complain

Shreyas Reddy
Ranch Hand

Joined: Oct 09, 2003
Posts: 49
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

Joined: Feb 05, 2001
Posts: 17260
    
    6

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 ]

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

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

Joined: Aug 17, 2001
Posts: 399
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


Malhar Barai
SOA & Java Book
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: incorrect web.xml doesn't complain