This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233112 - After adding Faces support to existing web app, welcome files are incorrectly set
Summary: After adding Faces support to existing web app, welcome files are incorrectly...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 7.4
Hardware: PC All
: P2 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-20 19:58 UTC by ecerichter
Modified: 2013-07-25 02:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (88.70 KB, text/plain)
2013-07-20 19:58 UTC, ecerichter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerichter 2013-07-20 19:58:29 UTC
Product Version = NetBeans IDE Dev (Build 201307172300)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01

Having an existing web app project using Tomcat 7, I want to incrementally change it from JSP only to Faces based.
I've open the project properties, and in "Frameworks", I've added "Java Server Faces", then selected Libraries -> JSF 2.2.
Added PrimeFaces 3.5 as components.
Mapped JSF pages to *.jsf.

After confirmation, I've noticed that web.xml have changed (as expected), but "welcome-file-list" is wrong.

The RESULTING configuration:
    <welcome-file-list>
        <welcome-file>index.jsf</welcome-file>
        <welcome-file>index.jsf</welcome-file>
        <welcome-file>index.jsf</welcome-file>
    </welcome-file-list>

The ORIGINAL configuration was:

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

The EXPECTED configuration is:

    <welcome-file-list>
        <welcome-file>index.jsf</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>


Thanks,

Edson Richter
Comment 1 ecerichter 2013-07-20 19:58:33 UTC
Created attachment 137491 [details]
IDE log
Comment 2 Martin Fousek 2013-07-24 11:18:11 UTC
This behaviour is intentional now. The JSF tries to translates your URLs to the new ones. See issue #182277 for additional comments around.

The question is what is the proper solution whether to change them or only add the JSF specific URL? It's true that you can have broken project now until you redesign the JSP file to the Facelet and also it changes your custom configuration to guessed one.

Probably I could change the original behavior to only include the JSF URL as the new one as you proposed in the first comment. It will still correspond with the https://netbeans.org/kb/docs/web/jsf20-intro.html tutorial (especially with the Important section which doesn't apply now.
Comment 3 Martin Fousek 2013-07-24 12:28:24 UTC
Fixed in web-main #af7c4edc514d.

It will not change the original welcome files and instead of this it will include the newest (JSF) one. It's probably more intuitive behaviour than the previous one. I tried scenario you sent and the content of the DD is:
<welcome-file-list>
    <welcome-file>index.jsf</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>
Comment 4 Quality Engineering 2013-07-25 02:30:01 UTC
Integrated into 'main-silver', will be available in build *201307242300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/af7c4edc514d
User: Martin Fousek <marfous@netbeans.org>
Log: #233112 - After adding Faces support to existing web app, welcome files are incorrectly set