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 114366 - 0830: sun-web.xml/Servlets tab can add dup servletName
Summary: 0830: sun-web.xml/Servlets tab can add dup servletName
Status: RESOLVED DUPLICATE of bug 67255
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-31 13:18 UTC by nouar38
Modified: 2010-08-31 20:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nouar38 2007-08-31 13:18:11 UTC
NB 6.0 200708300000 & GF v2 b53 & jdk 1.6 u1: tests done over win/xp

with a new web project, can Add in sun-web.xml "Servlets" tab many servlets ("button Add Servlet") with the same name
in the field Servlet Name: NewServlet (did this step 3 times)
on a 4 click "Add Servlet" button can see only the first NewServlet and in the new servlet form, kept the default name
as "servlet4".
go to XML tab and watch the content of sun-web.xml tag <servlet> </servlet> ==>> 4 entries where 3 has
<servlet-name>NewServlet</servlet-name>

when we do "Remove", the second dup entry shows up and can be removed, ..etc.
Servlet added with "Projects/New/Servlet" with the same name "NewServlet" has '?' in its entry in Servlets tab
and does not show up in XML tab.
Comment 1 _ pcw 2007-08-31 17:41:19 UTC
True.  I've been thinking about what to about this.

1. There should be a warning/error notation for duplicate fields.
2. We should not knowingly generate duplicate names.  The current generator has simple steps to avoid this, but it's
easily compromised, especially between IDE sessions.
Comment 2 nouar38 2007-09-05 13:31:29 UTC
general issue in Visual editor, as got same kind of issue when added two security roles with same name in
sun-application.xml defined for an EAR project ( also in sun-web.xml, sun-ejb-jar.xml)
Comment 3 _ pcw 2007-09-05 19:20:51 UTC
Correct.  This issue will affect all named beans across all sun descriptor files.  If I fix it, it will also
correspondingly fix all of them.
Comment 4 _ pcw 2007-09-22 01:37:46 UTC
I fixed the name generator so it will generate a unique default name for new beans (up to 100 tries per new bean, but
uses bsearch so it's fast).

If you manually modify the names to match beans you already have, well, then you'll have duplicates.  They will still be
unflagged as such.

There is still the issue that multiple entries from the configuration file with the same only show up as single entries
in the visual portion.
Comment 5 _ pcw 2007-10-29 22:04:22 UTC
I've thought about this quite a bit and it's rather difficult.  The problem is really "what is the right way to handle
duplicate names?"  Well, duplicate names in this context is an ERROR and should be flagged as such by any correct
solution.  Anything less is a hack and must be carefully considered that it won't cause more confusion that the original
problem.

I think that since for 6.0, the editor itself won't generate duplicate names is good enough.  If the duplicate names
come from another source (New Servlet Wizard), the user must correct their actual application before this file even
matters and that correction will likely fix the issues here as well.

So, defer to future when we have better error reporting.
Comment 6 Vince Kraemer 2009-09-16 23:59:50 UTC
assign outher half of pcw's issues
Comment 7 Vince Kraemer 2010-08-31 20:57:22 UTC
this is a generic problem in the gui editors

*** This bug has been marked as a duplicate of bug 67255 ***