- Using NB 6.1 FCS
- Create Web project
- Open the web.xml in XML view (optional to verify the inserted content).
- Create empty Java class
- type in 'aPath' in the java source editor
- depending on how busy is the system, after a while the ServletAdaptor declaration is insterted into the web.xml content.
- Also Jersey library is added to the project
Created attachment 61175 [details]
I believe this patch is a quick fix while waiting for the real fix by issue 126300.
Created attachment 61203 [details]
A better patch?
Hi Nam, I think the patch I just attached is a better solution. So, basically, the patch checks one character before the
error to see if it is a "@" before adding it to the diagnostics. I also used string equals instead of contains for match
with jsr311 annotation.
Having seen some large system code, I saw they do define their own annotation. We definitely don't want to risk the
collision due to lack of qualified path. We also need to take care of case code has 'import javax.ws.rs.*;'
Another code review side point that it would be good to preserve the generic purpose of method
getDiagnostics(FileObject) or if you are sure no other code path use it (It's been a while, I don't remember), you could
rename it to reflect what it actually doing. .
Can't we only turn rest support on if and only if user finish some REST services related wizard and if user creates some
class, add ie @Path there then leave it up to the user what (s)he will do (in this case (s)he mostly knows what (s)he's
So far we have 3 proposals:
(1) With my proposed fix, REST support is turned on when user type @javax.ws.rs.Path or import javax.ws.rs.Path.
(2) With Peter's patch, REST support is turned on when user type @Path, but NOT with import javax.ws.rs.Path.
(Similarly in both patches, with @GET, @PUT, @POST, @DELETE).
(3) Lukas proposal would be leaving its up to use to manually change web.xml and add REST library (of course, the wizard
currently already add REST support, exception are REST samples).
I would go with (3) if we could have a friendly mechanism to turn only REST. Otherwise, (1) is more accurate than (2).
Who know that some users meant to use another @my.org.Path annotation.
Fix checked into trunk:
Note that we decided to go with Nam's patch.
*** Issue 135593 has been marked as a duplicate of this issue. ***
The fix has been ported into the release61_fixes repository.
*** Issue 135284 has been marked as a duplicate of this issue. ***
Verified in Patch 2.
*** Issue 138952 has been marked as a duplicate of this issue. ***