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

welcome-file tag in DD

bnkiran kumar
Ranch Hand

Joined: Mar 02, 2006
Posts: 176
Hi All,

I referred dtd of web.xml, it tells <welcome-file-list> can occur zero or one time.i am putting <welcome-file-list> tag more than once, it is not throwing error. I am using tomcat 5.0. Can anybody suggest regarding this...






[BPSouther: changed subject line to match the actual issue in this thread]
[ June 27, 2007: Message edited by: Ben Souther ]

Kiran Kumar.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Which version are you using ? Version 2.4 states that there's only one welcome-file-list, which can contain multiple welcome-file. I've never heard of multiple welcome-file-list.


[My Blog]
All roads lead to JavaRanch
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by bnkiran kumar:
it is not throwing error. I am using tomcat 5.0.


It's probably ignoring one or the other.
Why are you doing this?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
bnkiran kumar
Ranch Hand

Joined: Mar 02, 2006
Posts: 176
Just i was checking,
<welcome-file-list>
<welcome-file>/Page1.jsp</welcome-file>
</welcome-file-list>

<welcome-file-list>
<welcome-file>/Page2.jsp</welcome-file>
</welcome-file-list>

In url i didnot mention file name, the folder has Page2.jsp not Page1.jsp, so Page2.jsp is getting displayed. I am confused with this behaviour...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

When you don't follow the spec you'll either get errors or you'll get unpredictable behavior.

The correct way to enter a welcome file hierarchy is to create one welcome-file entry with multiple welcome-page nodes.



I'm sure if you validated your web.xml file against its schema, this would be caught.

Again, I don't see the point in experimenting with things like this.
 
Consider Paul's rocket mass heater.
 
subject: welcome-file tag in DD
 
Similar Threads
Qn on welcome-file-lsit tag
Aliasing in tomcat for a jsp
Diiference between <welcome-file-list> tag and <load-on-startup> tag in web.xml file of servlet
can't use custom URLs in the welcome-file tag of web.xml?
"struts-tags" not found for Struts 2