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.
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.
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.
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.
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.
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.
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!!
> 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.
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
v.