Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356873

Summary: New HTML File wizard ignores multiple web content roots.
Product: [WebTools] WTP Source Editing Reporter: Slava Kabanovich <scabanovich>
Component: wst.htmlAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Nick Sandonato <nsand.dev>
Severity: normal    
Priority: P3 CC: alkazako, cbridgha, thatnitind
Version: unspecifiedFlags: nsand.dev: review+
Target Milestone: 3.3.2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
proposed patch none

Description Slava Kabanovich CLA 2011-09-06 19:42:07 EDT
Build Identifier: I20110613-1736

This happens, because method NewHTMLFileWizardPage.initialPopulateContainerNameField() overrides WizardNewFileCreationPage.initialPopulateContainerNameField() so that if the selected path is not located inside the default web content path then the former is replaced by the latter.
The check should be improved to accept the selected path if it is located inside any of web content root resources.

Reproducible: Always

Steps to Reproduce:
1. Create new Dynamic Web Project.
2. Create folder WebContent2 and modify file /.settings/org.eclipse.wst.common.component
by adding a line <wb-resource deploy-path="/" source-path="/WebContent2"/>
before line <wb-resource deploy-path="/" source-path="/WebContent"/>
3. Select folder WebContent in Package Explorer and invoke New HTML File wizard.
4. Make sure that container is initialized with WebContent2, not with WebContent - that is a bug.
Comment 1 Nitin Dahyabhai CLA 2011-09-06 22:38:00 EDT
Created attachment 202851 [details]
proposed patch
Comment 2 Nitin Dahyabhai CLA 2011-09-06 23:00:31 EDT
Created attachment 202852 [details]
proposed patch
Comment 3 Nick Sandonato CLA 2011-09-07 13:28:22 EDT
Looks good to me.
Comment 4 Nick Sandonato CLA 2011-11-18 14:34:34 EST
Code checked into 3_3_Maintenance and HEAD.