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

Bug 313576

Summary: JAX-RS tools- validation problems
Product: [WebTools] WTP Webservices Reporter: Eric Peters <ericdp>
Component: jst.wsAssignee: Eric Peters <ericdp>
Status: CLOSED FIXED QA Contact: Keith Chong <keith.chong.ca>
Severity: normal    
Priority: P1 CC: raghunathan.srinivasan
Version: 3.2Flags: keith.chong.ca: pmc_approved? (david_williams)
raghunathan.srinivasan: pmc_approved+
keith.chong.ca: pmc_approved? (naci.dai)
keith.chong.ca: pmc_approved? (deboer)
keith.chong.ca: pmc_approved? (neil.hauge)
keith.chong.ca: pmc_approved? (kaloyan)
keith.chong.ca: review+
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
patch for review
none
patch for review none

Description Eric Peters CLA 2010-05-19 12:54:56 EDT
For 1 & 3 (below) - we need to validate the servlet information fields as if some values are empty deploy to server will likely fail
For 2 - this is a bad usability problem for JEE6 applications

1. JAX-RS facet property page is not validating servlet name, this is a required field in web.xml as per (e.g.) http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
2. JAX-RS facet wizard page is showing a vlidation error for servlet group fileds when servlet group fields are disabled
3. No validation is performed for empty servlet class name (property page & facet wizard page), also a required field in web.xml as per (e.g.) http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
Comment 1 Eric Peters CLA 2010-05-19 12:59:38 EDT
Lack of validation is made worse as default value (first time through wizard) is empty string for JAX-RS user library as we do not infer the jaxrs.Application subclass from the supplied user library.
Comment 2 Eric Peters CLA 2010-05-19 13:39:20 EDT
1. 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. 

An adopter is requesting this fix to prevent deployment to server errors due to some missing validation made worse by the fact default servlet class name is empty for jax-rs user libraries.

2. Is there a work-around? If so, why do you believe the work-around is
insufficient? 

The user needs to know the fields missing validation need to be supplied/not-empty. 

3. How has the fix been tested? Is there a test case attached to the bugzilla
record? Has a JUnit Test been added? 

Patch tested as per:
Property Page
-------------
-no web.xml projects
-user library vs. adopter library
-switching between jax-rs implementation libraries


JAX-RS Facet
------------
-install/uninstall with and without web.xml
-toggling Update DD check box for Web 3.0 projects
-switching jax-rs implementation libraries

4. Give a brief technical overview. Who has reviewed this fix? 
What is the risk associated with this fix? 

Low risk of regression, tested thoroughly for both WTP and adopter scenarios.
Pending his review, Keith will put forth for PMC approval.
Comment 3 Eric Peters CLA 2010-05-19 13:40:42 EDT
Created attachment 169161 [details]
patch for review

Unit tested as per defect comments.
Comment 4 Eric Peters CLA 2010-05-19 14:12:41 EDT
Created attachment 169170 [details]
patch for review

Keith, v. small change as per your review comment. Retested affected UT scenarios.
Comment 5 Keith Chong CLA 2010-05-19 15:03:10 EDT
Submitting for PMC approval for RC2.  Patch looks good, and Eric has tested this thoroughly.

Note, a new string for the new validation message is added.

This should be picked up for translation during Babel PII drop #10.
Comment 6 Eric Peters CLA 2010-05-19 15:59:08 EDT
Comitted to head as 
org.eclipse.jst.ws.jaxrs.core=v201005191955
org.eclipse.jst.ws.jaxrs.ui=v201005191955
Comment 7 Eric Peters CLA 2010-06-17 15:43:04 EDT
verified in R-3.2.0-20100615235519