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.

Bug 20308 - web.xml is not updated after renaming the servlet package
Summary: web.xml is not updated after renaming the servlet package
Status: RESOLVED WORKSFORME
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: -FFJ-
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: jdi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-08 06:49 UTC by Mikhail Romanov
Modified: 2004-01-30 08:16 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
There is easy fix for 1 and 3. (1.34 KB, patch)
2002-11-25 14:27 UTC, Petr Pisl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Romanov 2002-02-08 06:49:37 UTC
Bug exists in FFJ CE Build 020207.

When one renames package, containing servlets, IDE proposes
to make appropriate changes in the servlets code, but it doesn't
propose to make any changes in the web.xml file.

However when one renames servlet file, IDE changes web.xml file
correctly.

How to reproduce:
1. Mount some web module
2. Create new servlet in WEB-INF/Classes in some packages, e.g.
servlets.Servlet
3. Try to rename servlets package in IDE - Information dialog appears, proposing
to change Java code of the classes in the package. However no changes in web.xml
are propsed. 
4. Try to rename Servlet class - IDE makes correct changes in the web.xml file
Comment 1 _ rkubacki 2002-03-21 13:18:32 UTC
commited to trunk (requires IDE spec version newer than 1.28)
http://web.netbeans.org/source/browse/web/advanced/src/org/netbeans/modules/web/ie/servlets/ServletIEDataObject.java.diff?r1=1.20&r2=1.21
Comment 2 Petr Jiricka 2002-04-23 10:09:25 UTC
Changing target milestone to FFJ 4.0
Comment 3 Petr Jiricka 2002-04-23 10:19:40 UTC
Changing target milestone to FFJ 4.0
Comment 4 Jason Rush 2002-04-24 00:33:23 UTC
Attempted to verify this in FFJ 4.0 Build 020423_ee.  However, the
servlet code was changed and no changes were propogated to the web.xml
file.
Comment 5 _ rkubacki 2002-04-24 07:42:35 UTC
This one is fixed in NB trunk code base.I'm not going to fix it in orion.
Comment 6 Jason Rush 2002-06-11 21:38:46 UTC
Verified in NB 3.4 dev build 200206070835.
Comment 7 Alexei Mokeev 2002-08-15 12:47:29 UTC
Still reproduced in Sierra
(S1S 4.1 20812 build)
Comment 8 Petr Pisl 2002-11-25 12:32:32 UTC
I tried it on the Netbeans 3.4 and the behavior is confusing. If you
rename a package which contains servlets, than Confirm Changes dialog
has text "Changes recommended in deployment descriptor of ..." and
contains all servlets which are in or under renaming package. But some
servlets doesn't have to have servlet elements in the deployment
descriptor. 

There are three confusing things:

1) In the Confirm Changes dialog are servlet-class, which doesn't have
servlet element in the deployment descriptor.

2) Servlet-class is updated correctly, but the servlet-mapping is not.
So the result after the renaming is for example:

<servlet>
    <servlet-name>test</servlet-name>
    <servlet-class>org10.test</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>test</servlet-name>
    <url-pattern>/servlet/org.test</url-pattern>
</servlet-mapping>

I suspect that the url-pattern will be /servlet/org10.test

3) When the user press button "Close" in the Confirm Changes dialog
and then try rename the  package again, then this dialog shows all
servlet under renaming package, but there isn't any servlet, which can
be changed. It is connected with the 1.

Comment 9 _ rkubacki 2002-11-25 12:54:12 UTC
1) and 3) is odd. ad 2) - there can be any string that may or may not
have relationship to servlet class name. I am not sure if it would be
transparent if the IDE changed the mapping path. Also there are
consequences like URI mapping of servlet DO and so on.
Comment 10 Petr Pisl 2002-11-25 14:27:51 UTC
Created attachment 8041 [details]
There is easy fix for 1 and 3.
Comment 11 Petr Pisl 2003-02-13 16:54:34 UTC
Fixed and integrated in the sierra fixies
Comment 12 genero 2004-01-26 08:45:06 UTC
Denis, please test in on Nevada and current trunk
Comment 13 jdi 2004-01-26 14:18:44 UTC
not reproduced in Nevada and current trunk
Comment 14 jdi 2004-01-30 08:16:08 UTC
Can not reproduce on current trunk