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.
Build 020408_1: Current ide behavior: 1. leave context root empty is OK. 2. user cannot set context root as "/". 3. user cannot set context root as something like mymapping. It has to be /mymapping. Here is what is expected behavior according to Jeff Hoffman: "I thought we decided to add the slash to the beginning if the user didn't put it there. I think 2 and 3 should be acceptable in the UI and we should just do the right thing behind the scenes. I don't think there's a chance that the user would want "//" or "//mymapping", so I should be able to enter "/" or empty (both mean the same thing--root context), and I should be able to enter "mymapping" or "/mymapping" (both mean the same thing--mymapping context)."
Servlet2.3 spec chapter 4 The Request, paragraph SRV.4.4 Request Path Elements Context Path: The path prefix associated with the ServletContext that this servlet is part of. If this context is the "default" context rooted at the base of the web server's URL name space, this path will be an empty string. Otherwise, if the context is not rooted at the root of server namespace, the path starts with a "/" character but does not end with a "/" character. It means that 2 and 3 are not valid.
I don't want to argue the point against the spec. You know the spec and now I know the exact wording of the spec. Also, the IDE should know the spec to help the user in this case. I'll accept that #2 is invalid. If I enter a "/", the fact that the IDE gives you a warning is good. However, I think it would be much friendlier if #3 was acceptable to the IDE and that it adds the beginning slash when deploying the web module. The current behavior (showing a warning) is somewhat annoying considering that the IDE can easily assist the user here.
x
Currently the issue is: if user sets context root to something that doesn't starts with slash add this slash. Should we notify user about this change in such case? If the message is enough descriptive I'd rather close this as WONTFIX.
Currently the behaviour is little bit different than Radim writes - The message:"The URI string shouldn't start with slash character" is shown when user forgets to put slash at the beginning. Now - according to the Jeff's sugesstion - the URI with missing initial slash is accepted and the slash is added then at the deployment time by the (Tomcat)plugin. Fixed in Netbeans 3.4
The fix applied by Milan and the behavior after the fix is not acceptable. Now the user is allowed to enter URI which is not compliant with the specification, which is wrong. Furthermore, the actual URI used for deployment is not the same as the user sees in the property value, which will lead to user confusion. Finally, now all plugins (not only the Tomcat plugin !) are required to handle paths which are not spec.compliant, so this really amounts to an incompatible change in the SI APIs. I suggest the fix should be to allow the user enter non- compliant value, but change it in the text field,e.g. the user would enter 'mymapping' and the field would display '/mymapping'.
Set target milestone to TBD
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss