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 117888 - Problem with Set Servlet Execution URI
Summary: Problem with Set Servlet Execution URI
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2007-10-05 10:42 UTC by xoom
Modified: 2007-12-07 16:41 UTC (History)
2 users (show)

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 xoom 2007-10-05 10:42:57 UTC
Hello, I have found a problem working with servlets.

When you create a new Servlet with the IDE, you can set any time the servlet execution URI with the corresponding option
in Tools menu, but this option IS NOT AVAILABLE when you create the new servlet manually (creating the new file and
placing it in WebApp\src\java directory.

Sorry, but I'm Spanish and I don't write English so good.

Thanks.
Comment 1 Jan Horvath 2007-10-05 10:52:42 UTC
When you create a servlet class manually, than you have to add servlet to the web.xml manually as well. You can do it in web.xml editor, Servlets tab. Just 
click on the button Add Servlet Element, and fill servlet class, URL ...

After the element is added to the web.xml you can work with the servlet same way as if it is created by the wizard.
Comment 2 xoom 2007-10-05 11:38:52 UTC
Thank you, but... Look at this example:

- If I create a servlet class with the IDE, I can set a servlet execution URI for it like this (/NewServlet?user=xoom)
including parameters. When I RUN this servlet, it is called in the web navigator WITH THIS PARAMETER (the URL includes
the parameters). This parameters isn't keep in the web.xml but in <user_dir>\.netbeans\5.5.1\var\attributes.xml

- If I create a new servlet class manually, I haven't the possibility to DO THIS. I haven't set a servlet execution uri
for my servlet (INCLUDING REQUEST PARAMETERS) except if I edit manually this file (attributes.xml). Then, when I run my
servlet, this isn't oppened in the navigator including the request parameters because they aren't remembered by NetBeans
since they are NOT preserved in attributes.xml

Then I cannot work with the servlet exactly as if it is created by the wizard.

Thanks again.
Comment 3 Tomas Mysik 2007-10-05 13:09:59 UTC
Are you able to reproduce this issue in NB 6.0 please? I've tried to do so and it seems that everything is ok (if I 
understand well where the problem is).

Just to be sure - it's possible to create servlet mapping like this one using the wizard. It's also possible to change 
it (using NB XML editor or directly changing the source code of web.xml).
    <servlet-mapping>
        <servlet-name>NewServlet</servlet-name>
        <url-pattern>/NewServlet?a=b</url-pattern>
    </servlet-mapping>

Am I missing anything? If so, reopen this issue please. Thank you.
Comment 4 xoom 2007-11-05 11:31:06 UTC
Hello again. Thanks for your interesting.

I installed NB 6.0 beta 2 and I probed it and I have noted that the option "Set Servlet Execution URI" in Tools menu
never appears, even with servlets that have been created with the assistant.

Probe the following:

1 - Create a new Application Project with default values.
2 - Add a new Servlet with contextual menu: New > Servlet.
3 - When you have selected the servlet in Tools menu appears the "Set Servlet Execution URI" option.
4 - Run the Servlet with "Run File" with its contextual menu. First time is showed the "Set Servlet Execution URI"
dialog which indicates: "You can change the execution URI later via Tools > Set Servlet Execution URI".

The request parameters you include (if so) IS NOT SAVED IN WEB.XML, but in <user_dir>\.netbeans\5.5.1\var\attributes.xml

In NB 6.0 beta 2, this menu option IS NEVER SHOWED, but in NB 5.5 yes!

In addition, with NB 5.5 the problem I found is that this option only is showed with servlets created with New > Servlet
but not with servlets created as a Java source that later I convert into a Servlet.
Comment 5 xoom 2007-11-05 11:34:59 UTC
The servlet mapping you indicated:

    <servlet-mapping>
        <servlet-name>NewServlet</servlet-name>
        <url-pattern>/NewServlet?a=b</url-pattern>
    </servlet-mapping>

I have probed and DON'T WORK for directly passing request parameters to the Servlet!!
Comment 6 Tomas Mysik 2007-11-06 15:09:05 UTC
> The request parameters you include (if so) IS NOT SAVED IN WEB.XML, but in
> <user_dir>\.netbeans\5.5.1\var\attributes.xml
> In NB 6.0 beta 2, this menu option IS NEVER SHOWED, but in NB 5.5 yes!

Good catch, you are right. It's bug, this context menu action should be there.
Thanks for reporting.
Comment 7 Tomas Mysik 2007-11-08 09:34:17 UTC
Should be fixed now - Dan verify please on Windows. Thanks.

Checking in web/project/src/org/netbeans/modules/web/project/WebActionProvider.java;
/cvs/web/project/src/org/netbeans/modules/web/project/WebActionProvider.java,v  <--  WebActionProvider.java
new revision: 1.94; previous revision: 1.93
done
Comment 8 Dan Kolar 2007-11-13 10:45:05 UTC
v.