Re: Default page like index.m

Ted Husted <[email protected]>
Newsgroups gmane.comp.web.maverick.general
Organization Apache Software Foundation - Jakarta Project
Message-ID <[email protected]>
The welcome-file-list is just that, a list. The http server is suppose 
to run down the list, looking for each file, and the first one it find 
wins. If none of these are found in the file system, then it's 404. The 
servlet container portion of the code is not involved in any of this.

A index.vm is a physical file that the http server can see and select 
it, same as an index.jsp or an index.html. A index.m is not a physical 
file, as far as the http server is concerned it doesn't exist.

The underlying problem is that the serlvet container is an extension to 
http. The usual http rules are applied first, and then the servlet hands 
off to the container. In the case of the welcome page, if the 
welcome-file isn't there, the http rules say it should return 404.

I suppose the big solution would be for http servers to support a 
welcome-uri alternative that could be used instead of welcome-file-list, 
but it's not so hard to use a index.html to redirect to your usual 
welcome uri =:0)

-Ted.

Doug Kirk wrote:
> Hmmm.  I have the following in my web.xml and it works just fine:
> 
> <welcome-file-list>
>   <welcome-file>index.vm</welcome-file>
> </welcome-file-list>
> 
> *.vm is mapped to the VelocityLayoutServlet in my webapp's web.xml.
> 
> I would expect a specification of 'index.m' to work as well, since it's 
> just running the servlet that's mapped to '*.m'. And after all, '*.jsp' 
> is just a mapping to the JspServlet in the master web.xml in the Tomcat 
> configuration.
> 
> So, in Tomcat (at least 4.1.24), I think setting the welcome file list 
> in web.xml appropriately should work.
> 
>> How can you set up the default page to work like index.jsp would 
>> without a browser redirect?
>>
>> Travis
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> [INVALID FOOTER]
> 

-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
[INVALID FOOTER]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.