strange welcome-files behavior...

View: New views
5 Messages — Rating Filter:   Alert me  

strange welcome-files behavior...

by vince kraemer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a web app  that user JSF 2.0 and maps all faces/* to the
FacesServlet (pretty standard stuff).

The web apps web.xml file has a welcome-file-list that has one entry...
an entry for faces/index.xhtml

If the app only has /index.xhtml, this app displays it (after being
processed by the FacesServlet..)

If there is a /index.jsp as well as a /index.xhtml, the index.jsp file
is displayed.

This seems a bit unexpected... It the server was able to default to
http://localhost:8080/CR/faces/index.xhtml when there wasn't an
index.jsp file in the app, why would it decide to use index.jsp instead
when it is present in the app.

Thanks,
vbk


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: strange welcome-files behavior...

by Shing Wai Chan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The index.jsp is coming from default-web.xml.
We may have a problem in the ordering in this case.
Shing Wai Chan

vince kraemer wrote:

> I have a web app  that user JSF 2.0 and maps all faces/* to the
> FacesServlet (pretty standard stuff).
>
> The web apps web.xml file has a welcome-file-list that has one
> entry... an entry for faces/index.xhtml
>
> If the app only has /index.xhtml, this app displays it (after being
> processed by the FacesServlet..)
>
> If there is a /index.jsp as well as a /index.xhtml, the index.jsp file
> is displayed.
>
> This seems a bit unexpected... It the server was able to default to
> http://localhost:8080/CR/faces/index.xhtml when there wasn't an
> index.jsp file in the app, why would it decide to use index.jsp
> instead when it is present in the app.
>
> Thanks,
> vbk
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: strange welcome-files behavior...

by Shing Wai Chan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have looked at the war file. The behavior is expected.
Here is what happens:
1. default-web.xml append index.jsp to welcome file list
2. access "<context-root>/" --> welcome files
3. GlassFish will
    i) look up the existing resource first
    ii) and then the urls

Case A: no index.jsp
     i) no found
     ii) found

Case B: has index.jsp
     i) find index.jsp, stop no need to do (ii)

Regards,
      Shing Wai Chan
     

Shing Wai Chan wrote:

> The index.jsp is coming from default-web.xml.
> We may have a problem in the ordering in this case.
> Shing Wai Chan
>
> vince kraemer wrote:
>> I have a web app  that user JSF 2.0 and maps all faces/* to the
>> FacesServlet (pretty standard stuff).
>>
>> The web apps web.xml file has a welcome-file-list that has one
>> entry... an entry for faces/index.xhtml
>>
>> If the app only has /index.xhtml, this app displays it (after being
>> processed by the FacesServlet..)
>>
>> If there is a /index.jsp as well as a /index.xhtml, the index.jsp
>> file is displayed.
>>
>> This seems a bit unexpected... It the server was able to default to
>> http://localhost:8080/CR/faces/index.xhtml when there wasn't an
>> index.jsp file in the app, why would it decide to use index.jsp
>> instead when it is present in the app.
>>
>> Thanks,
>> vbk
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: strange welcome-files behavior...

by Shing Wai Chan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
According the comment in default-web.xml,

 <!-- If you define welcome files in your own application's
web.xml        -->
 <!-- deployment descriptor, that list *replaces* the list
configured      -->
 <!-- here, so be sure that you include any of the default values
that     -->
 <!-- you wish to include.

(1) below should not happen when there is a welcome file defined in web.xml.
I have just checkin a fix for this.

In otherwise, we have the following
(1') there is an entry in web.xml, so welcome file in default-web.xml
will not be added
(2) access "<context-root>/" --> welcome files
3. GlassFish will
   i) look up the existing resource first corresponding to welcome files set
   ii) and then the urls

Case A: no index.jsp
    i) no found
    ii) found

Case B: has index.jsp
    i) index.jsp is not part of welcome file sets, so no found
    ii) found

Thanks.
    Shing Wai Chan


Shing Wai Chan wrote:

> I have looked at the war file. The behavior is expected.
> Here is what happens:
> 1. default-web.xml append index.jsp to welcome file list
> 2. access "<context-root>/" --> welcome files
> 3. GlassFish will
>    i) look up the existing resource first
>    ii) and then the urls
>
> Case A: no index.jsp
>     i) no found
>     ii) found
>
> Case B: has index.jsp
>     i) find index.jsp, stop no need to do (ii)
>
> Regards,
>      Shing Wai Chan
>    
> Shing Wai Chan wrote:
>> The index.jsp is coming from default-web.xml.
>> We may have a problem in the ordering in this case.
>> Shing Wai Chan
>>
>> vince kraemer wrote:
>>> I have a web app  that user JSF 2.0 and maps all faces/* to the
>>> FacesServlet (pretty standard stuff).
>>>
>>> The web apps web.xml file has a welcome-file-list that has one
>>> entry... an entry for faces/index.xhtml
>>>
>>> If the app only has /index.xhtml, this app displays it (after being
>>> processed by the FacesServlet..)
>>>
>>> If there is a /index.jsp as well as a /index.xhtml, the index.jsp
>>> file is displayed.
>>>
>>> This seems a bit unexpected... It the server was able to default to
>>> http://localhost:8080/CR/faces/index.xhtml when there wasn't an
>>> index.jsp file in the app, why would it decide to use index.jsp
>>> instead when it is present in the app.
>>>
>>> Thanks,
>>> vbk
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: strange welcome-files behavior...

by vince kraemer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks,

vbk

Shing Wai Chan wrote:

> Hi all,
> According the comment in default-web.xml,
>
> <!-- If you define welcome files in your own application's
> web.xml        -->
> <!-- deployment descriptor, that list *replaces* the list
> configured      -->
> <!-- here, so be sure that you include any of the default values
> that     -->
> <!-- you wish to include.
>
> (1) below should not happen when there is a welcome file defined in
> web.xml.
> I have just checkin a fix for this.
>
> In otherwise, we have the following
> (1') there is an entry in web.xml, so welcome file in default-web.xml
> will not be added
> (2) access "<context-root>/" --> welcome files
> 3. GlassFish will
>   i) look up the existing resource first corresponding to welcome
> files set
>   ii) and then the urls
>
> Case A: no index.jsp
>    i) no found
>    ii) found
>
> Case B: has index.jsp
>    i) index.jsp is not part of welcome file sets, so no found
>    ii) found
>
> Thanks.
>    Shing Wai Chan
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...