You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Ferdinand Soethe <sa...@soethe.net> on 2005/04/29 18:24:23 UTC

Why is default start page fixed on index.html?

Trying to better understand the structure of site.xml I reduced it to
an absolute minimum of

<site label="MyProj" href="intro.html" xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
</site>

and expected Forrest to open intro.xml without menus or tabs.
Instead I got the following error

> Request URI
> 
> index.html
> 
> cause
> 
> No pipeline matched request: index.xml
> 
> request-uri
> 
> /index.html

Anybody know why?
Problem remains when I try

<site label="MyProj" href="intro.html" xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
  <about label="About" href="intro.html"/> 
</site>

or

<site label="MyProj" href="" xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
  <about label="About" href="intro.html"/> 
</site>

and will disappear only when I place an index.xml in the xdocs
directory.

So why does Forrest want index.html. Is this a bug?

--
Ferdinand Soethe


Re: Why is default start page fixed on index.html?

Posted by Ross Gardler <rg...@apache.org>.
Nicola Ken Barozzi wrote:
> Ross Gardler wrote:
> ...
> 
>> Cocoon has to know where to start working, by default it starts at 
>> index.html. It is configurable somewhere, but I can't remember where. 
>> Someone else will speak up I hope.
> 
> 
> LAst time I touched it, it started at linkmap.html, so that it did not 
> need to have index.html.

Ferdinands experiments appear to show that it does need one, see below...

> 
>>> and will disappear only when I place an index.xml in the xdocs
>>> directory.
>>>
>>> So why does Forrest want index.html. Is this a bug?
>>
>>
>> No, a "feature". Since the vast majorty of web servers are set up to 
>> default to index.html it would seem like a very logical choice, and 
>> since it *can* be configured where necessary I wouldn't see it as a bug.
> 
> 
> Probably it's that some links do not have the filename, so in *that* 
> case, index.html is called as the default file for a dir.

Yes:

 From cli.xconf:

    <!--+
        |  Specifies the filename to be appended to URIs that
        |  refer to a directory (i.e. end with a forward slash).
        +-->
    <default-filename>index.html</default-filename>

Also from sitemap.xmap:

       <map:match pattern="">
         <map:redirect-to uri="index.html" />
       </map:match>
       <map:match type="regexp" pattern="^.+/$">
           <map:redirect-to uri="index.html"/>
       </map:match>

Ross

Re: Why is default start page fixed on index.html?

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Ross Gardler wrote:
...
> Cocoon has to know where to start working, by default it starts at 
> index.html. It is configurable somewhere, but I can't remember where. 
> Someone else will speak up I hope.

LAst time I touched it, it started at linkmap.html, so that it did not 
need to have index.html.

>> and will disappear only when I place an index.xml in the xdocs
>> directory.
>>
>> So why does Forrest want index.html. Is this a bug?
> 
> No, a "feature". Since the vast majorty of web servers are set up to 
> default to index.html it would seem like a very logical choice, and 
> since it *can* be configured where necessary I wouldn't see it as a bug.

Probably it's that some links do not have the filename, so in *that* 
case, index.html is called as the default file for a dir.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: Why is default start page fixed on index.html?

Posted by Ross Gardler <rg...@apache.org>.
Ferdinand Soethe wrote:
> Ross Gardler wrote:
> 
> RG> No, a "feature". Since the vast majorty of web servers are set up to
> RG> default to index.html it would seem like a very logical choice, and
> RG> since it *can* be configured where necessary I wouldn't see it as a bug.
> 
> Thanks. It makes sense and it doesn't. In terms of the logic of site
> it doesn't. I'll add a comment about this in site.xml
> 
> <!-- Note: No matter what you configure here, Forrest will always try to load
>        index.html when you request http://yourHost/
>    -->

By all means add the comment, but also add info on how this behaviour 
can be configured.

Ross

Re: Why is default start page fixed on index.html?

Posted by Ferdinand Soethe <sa...@soethe.net>.
Ross Gardler wrote:

RG> No, a "feature". Since the vast majorty of web servers are set up to
RG> default to index.html it would seem like a very logical choice, and
RG> since it *can* be configured where necessary I wouldn't see it as a bug.

Thanks. It makes sense and it doesn't. In terms of the logic of site
it doesn't. I'll add a comment about this in site.xml

<!-- Note: No matter what you configure here, Forrest will always try to load
       index.html when you request http://yourHost/
   -->

--
Ferdinand Soethe


Re: Why is default start page fixed on index.html?

Posted by Ross Gardler <rg...@apache.org>.
Ferdinand Soethe wrote:
> Trying to better understand the structure of site.xml I reduced it to
> an absolute minimum of
> 
> <site label="MyProj" href="intro.html" xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
> </site>
> 
> and expected Forrest to open intro.xml without menus or tabs.
> Instead I got the following error
> 
> 
>>Request URI
>>
>>index.html
>>
>>cause
>>
>>No pipeline matched request: index.xml
>>
>>request-uri
>>
>>/index.html
> 
> 
> Anybody know why?
> Problem remains when I try
> 
> <site label="MyProj" href="intro.html" xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
>   <about label="About" href="intro.html"/> 
> </site>

Cocoon has to know where to start working, by default it starts at 
index.html. It is configurable somewhere, but I can't remember where. 
Someone else will speak up I hope.

> and will disappear only when I place an index.xml in the xdocs
> directory.
> 
> So why does Forrest want index.html. Is this a bug?

No, a "feature". Since the vast majorty of web servers are set up to 
default to index.html it would seem like a very logical choice, and 
since it *can* be configured where necessary I wouldn't see it as a bug.

Ross

Re: Why is default start page fixed on index.html?

Posted by Ross Gardler <rg...@apache.org>.
(this is now a dev discussion and should be moved to the dev list - I've 
set the reply-to header on this mail - interested people should follow 
it there)

comments inline...

Ferdinand Soethe wrote:
> Ross Gardler wrote:
> 
> 
>>Again, I don't think this is a "problem" it is standard for web
>>servers to default to index.html.
> 
> 
> While I can see where this setting is coming from, and think that it
> makes sense to have this as an implicit setting for directories where
> not start-page is named, I don't think that we should keep this for
> the sites start-page for two reasons:

My point is that something has to be the default, somewhere you have to 
tell Forrest where to start.

Of course, our current behaviour follows the standard behaviour of web 
servers and therefore I agree that there is an argument for making it 
more configurable for use in other use cases.

However, as things stand it *is* configurable so there is no limitations 
as to what an individual user chooses as their start page so the 
argument about different languages and use cases does not convince me, 
not sure about others though (given that I agree it should be more 
easily configured).

Having said that Cyriaque raises a good point with respect to skins 
depending on "index.html" to decide on some content. This is something 
we should address in views.

> - The internal logic of site would benefit a lot if we used the
>   attribute href in the site-element to determine which page to open
>   first. And if no href is given or it is empty, fine use index.html
>   as startup like before and in any other directory.

This will require some preprocessing of the site.xml file to extract the 
start URL. However, we can't do that because we don't know that a 
site.xml file is being provided since this is an internal format, not 
necessarily the source format.

>   Sounds to me like a very consistent approach. Is it difficult to
>   change that?

Don't know, but it will not be as simple as you may think (see above).

Ross

Re: Why is default start page fixed on index.html?

Posted by Ferdinand Soethe <sa...@soethe.net>.
Ross Gardler wrote:

> Again, I don't think this is a "problem" it is standard for web
> servers to default to index.html.

While I can see where this setting is coming from, and think that it
makes sense to have this as an implicit setting for directories where
not start-page is named, I don't think that we should keep this for
the sites start-page for two reasons:

- Foreign language CD documentation projects might want to give the start
  page a name that is easy to understand for people who don't use
  auto starts and access the directory directly.

  Naming it 'index' is misleading even in English as it is not the
  index-page.

  

- The internal logic of site would benefit a lot if we used the
  attribute href in the site-element to determine which page to open
  first. And if no href is given or it is empty, fine use index.html
  as startup like before and in any other directory.

  Sounds to me like a very consistent approach. Is it difficult to
  change that?
  




--
Ferdinand Soethe


Re: Why is default start page fixed on index.html?

Posted by Thorsten Scherler <th...@apache.org>.
On Mon, 2005-05-02 at 12:44 +0100, Ross Gardler wrote:
> Cyriaque Dupoirieux wrote:
> .... 
> > OK, but the problem is many skins - such as pelt if I remember - use 
> > "index.html" string in tests to generate xhtml - such as the credits or 
> > some other features.
> 
> This is a good point, I wonder if Thorsten is reading this and can
> address this in the fortcoming views.

:) yes I already did. ;-) Due to the fact that the view is default (for
all pages the same) or page specific the contracts are get pulled from
the view and do not have (or better said should not<- have to have a
look in the code) such dependencies.

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Why is default start page fixed on index.html?

Posted by Ross Gardler <rg...@apache.org>.
Cyriaque Dupoirieux wrote:
> Ross Gardler a écrit :
> 
>> Ferdinand Soethe wrote:
>>
>>> Looking at the client-server dialog when asking for localhost:8888 I
>>> found that a
>>>
>>> get /
>>>
>>> is replied to by
>>>
>>> HTTP/1.x 302 Moved Temporarily
>>> Date: Fri, 29 Apr 2005 16:48:41 GMT
>>> Server: Jetty/4.2.19 (Windows XP/5.1 x86 java/1.4.2_02)
>>> X-Cocoon-Version: 2.2.0-dev
>>> Transfer-Encoding: chunked
>>> Location: http://localhost:8888/index.html
>>>
>>> So is this a problem of jetty rather than Forrest?
>>
>>
>>
>> Again, I don't think this is a "problem" it is standard for web 
>> servers to default to index.html.
> 
> 
> It is not standard for Web servers to default to index.html but a 
> configuration :

Yes, that's what I meant. In web servers it is normal to use a *default*
of index.html (and usually a few others that are relevant). This is
*exactly* how Forrest behaves. The *default* is to use index.html.

html is the only extension that makes sense in our default environment
so there is no need for additional extensions. Furthermore you can
configure the filename to be something else. Therefore our behaviour is
the same as everyone elses.

>> If you want to change it then you need to override the redirect that 
>> is in the forrest sitemap.xmap file by creating your own project sitemap.
> 
> 
> OK, but the problem is many skins - such as pelt if I remember - use 
> "index.html" string in tests to generate xhtml - such as the credits or 
> some other features.

This is a good point, I wonder if Thorsten is reading this and can
address this in the fortcoming views.

> It would have been nice to use the project.start-uri property or 
> something like this.

Sure, easier configuration of the start URI is good, patches accepted :-))

Ross






Re: Why is default start page fixed on index.html?

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Ross Gardler a écrit :

> Ferdinand Soethe wrote:
>
>> Looking at the client-server dialog when asking for localhost:8888 I
>> found that a
>>
>> get /
>>
>> is replied to by
>>
>> HTTP/1.x 302 Moved Temporarily
>> Date: Fri, 29 Apr 2005 16:48:41 GMT
>> Server: Jetty/4.2.19 (Windows XP/5.1 x86 java/1.4.2_02)
>> X-Cocoon-Version: 2.2.0-dev
>> Transfer-Encoding: chunked
>> Location: http://localhost:8888/index.html
>>
>> So is this a problem of jetty rather than Forrest?
>
>
> Again, I don't think this is a "problem" it is standard for web 
> servers to default to index.html.

It is not standard for Web servers to default to index.html but a 
configuration :
In my Apache Server :

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
    DirectoryIndex *index.html index.htm index.php3 index.php*
</IfModule>

Which means : if the URL is a directory :

    * try to load index.html,
    * if it does not exist, try to load index.htm,
    * if it does not exist, try to load index.php3,
    * if it ...


>
> If you want to change it then you need to override the redirect that 
> is in the forrest sitemap.xmap file by creating your own project sitemap.

OK, but the problem is many skins - such as pelt if I remember - use 
"index.html" string in tests to generate xhtml - such as the credits or 
some other features.
It would have been nice to use the project.start-uri property or 
something like this.

Regards,
Cyriaque,

>
> Ross
>
>

Re: Why is default start page fixed on index.html?

Posted by Ross Gardler <rg...@apache.org>.
Ferdinand Soethe wrote:
> Looking at the client-server dialog when asking for localhost:8888 I
> found that a
> 
> get /
> 
> is replied to by
> 
> HTTP/1.x 302 Moved Temporarily
> Date: Fri, 29 Apr 2005 16:48:41 GMT
> Server: Jetty/4.2.19 (Windows XP/5.1 x86 java/1.4.2_02)
> X-Cocoon-Version: 2.2.0-dev
> Transfer-Encoding: chunked
> Location: http://localhost:8888/index.html
> 
> So is this a problem of jetty rather than Forrest?

Again, I don't think this is a "problem" it is standard for web servers 
to default to index.html.

If you want to change it then you need to override the redirect that is 
in the forrest sitemap.xmap file by creating your own project sitemap.

Ross

Re: Why is default start page fixed on index.html?

Posted by Ferdinand Soethe <sa...@soethe.net>.
Looking at the client-server dialog when asking for localhost:8888 I
found that a

get /

is replied to by

HTTP/1.x 302 Moved Temporarily
Date: Fri, 29 Apr 2005 16:48:41 GMT
Server: Jetty/4.2.19 (Windows XP/5.1 x86 java/1.4.2_02)
X-Cocoon-Version: 2.2.0-dev
Transfer-Encoding: chunked
Location: http://localhost:8888/index.html

So is this a problem of jetty rather than Forrest?
--
Ferdinand Soethe