Saving changes made to web.xml via [message #308381] |
Thu, 21 September 2006 08:22 |
Eclipse User |
|
|
|
Originally posted by: mlh.kapowtech.com
I am developing a WebApplication Facet, and is trying to register a
servlet in the web.xml of the project. I am not sure if I do this
correct, because I seem to loose the changes made to web.xml. First time
I dont see any changes. If I have web.xml open in the editor, I dont see
the changes, but the file is left unsaved.
How do I make sure my changes to WebApp is saved into web.xml?
My code looks like this...
WebArtifactEdit edit = WebArtifactEdit.getWebArtifactForRead(project);
WebApp root = edit.getWebApp();
WebapplicationFactory appFactory = WebapplicationFactory.eINSTANCE;
Servlet servlet = appFactory.createServlet();
ServletType servletType = appFactory.createServletType();
servletType.setClassName(servletClass);
servlet.setWebType(servletType);
servlet.setServletName(servletName);
root.getServlets().add(servlet);
project.refreshLocal(IProject.DEPTH_INFINITE, monitor);
any help is helpful :-)
Mads
|
|
|
Powered by
FUDForum. Page generated in 0.02976 seconds