Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319558 - Cannot use existing Listener in Web projects
Summary: Cannot use existing Listener in Web projects
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.servlet (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.5   Edit
Assignee: Salvador Zalapa CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 09:25 EDT by Carl Anderson CLA
Modified: 2011-10-18 10:27 EDT (History)
2 users (show)

See Also:
zalapa: pmc_approved? (david_williams)
zalapa: pmc_approved? (raghunathan.srinivasan)
zalapa: pmc_approved? (naci.dai)
zalapa: pmc_approved? (deboer)
zalapa: pmc_approved? (neil.hauge)
kaloyan: pmc_approved+
zalapa: pmc_approved? (cbridgha)
cbridgha: review+


Attachments
Patch to enale the option " Use existing Listener class " (30.82 KB, patch)
2011-06-10 15:49 EDT, Salvador Zalapa CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Anderson CLA 2010-07-12 09:25:38 EDT
Steps to reproduce:

1 Create a Web project (2.3 or above)
2 Bring up the New Listener Wizard, and add a new Listener.
3 Remove the Listener from the web.xml, but don't delete the java file
4 Bring up the New Listener Wizard again.  The "Use existing Listener class" checkbox (and corresponding section) are always disabled.

Note that this really has no effect on Web 3.0 projects, since the Listener is added via annotation, and thus no web.xml entry is created- the listener is just there.  However, for Web 2.3, 2.4, and 2.5 projects, this does have an impact.

Also, this has been broken since these wizards were reworked for WTP 3.0.
Comment 1 Carl Anderson CLA 2010-07-12 09:31:34 EDT
Assigning to Dimitar for initial investigation.  Please retarget as you deem appropriate.

In NewListenerClassWizardPage.createTopLevelComposite(), it has:

existingButton.setEnabled(false);

As far as I can tell, there is no way to get this to switch to enabled.  I am not sure if this was done intentionally, but it was preserved during the rework for bug 205330 , so I am hesitant to remove it without knowing why this was done, and without a lot of testing to ensure that this composite, once enabled, works properly.  (If that checkbox should always be disabled, we should strongly consider hiding/removing this area of the wizard.)
Comment 2 Dimitar Giormov CLA 2011-01-31 02:46:17 EST
I remember commenting this code for a reason, but I do not remember the reason, so just to be safe will re-target the bug to 3.3
Comment 3 Dimitar Giormov CLA 2011-05-20 02:52:45 EDT
Re-targeting for SR1
Comment 4 Salvador Zalapa CLA 2011-06-10 15:49:51 EDT
Created attachment 197817 [details]
Patch to enale the option " Use existing Listener class "

Attaching a proposed patch for review.
Comment 5 Chuck Bridgham CLA 2011-06-14 16:21:20 EDT
These changes look good.
Comment 6 Salvador Zalapa CLA 2011-06-27 12:21:04 EDT
PMC REVIEW REQUESTED DUE TO UI CHANGE

Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such.
*In the New Listener Wizard, the user is not able to use an existing class since the checkbox is disabled.

Is there a work-around? If so, why do you believe the work-around is insufficient? 
*There are not work-around in the wizard, the user have to edit manually the web.xml file in order to use an existing class.


How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
*It has been tested manually (UI)
    
Give a brief technical overview. Who has reviewed this fix? 
*This fix enables the checkbox "Use an existing class", and provides a dialog with the classes that implement one of the listener interfaces, the classes are listed and the user can select just one. So, there are some UI changes.
    
What is the risk associated with this fix?
*Low since that checkbox was not used.
Comment 7 Carl Anderson CLA 2011-06-27 12:43:15 EDT
To be clear, we are seeking PMC approval to put this bug into all of our active development streams - WTP 3.2.5, 3.3.1, and 3.4.0 (which does not require PMC approval, but I listed it to be clear on where this change is going.)
Comment 8 Kaloyan Raev CLA 2011-07-07 12:19:39 EDT
This was a missing functionality in the initial contribution of the Listener wizard. Thanks for adding it. 

Approved.
Comment 9 Carl Anderson CLA 2011-07-07 14:42:10 EDT
Committed to R3_2_maintenance and HEAD for WTP 3.2.5, 3.3.1, and 3.4.0