- This topic has 6 replies, 3 voices, and was last updated 20 years, 9 months ago by
Ronald van Kuijk.
-
AuthorPosts
-
How does one regenerate the web.xml file?
I have accidentally deleted it from a webproject – I can manually create it but it is then not maintained when I add any new servlets!
Thanks
Chris Parsons
Riyad KallaMemberChris,
You can doc your Servlets/Actions/etc appropriately then setup a Web Doclet in your project to parse those resources and generate the web.xml file.Thank you – but I am a little confused, if I create a new web project and add a new servlet, the web.xml file is created and maintained automatically for me, without me having to write any webdoclets??
I am trying to get back to this state?
Thanks
Chris
Riyad KallaMemberChris,
Yes adding a new servlet and updating the web.xml file with that new servlet is part of the MyEclipse servlet wizard, but if after you have a project, you toast the web.xml file, there isn’t a ‘regenerate’ functionality persay, but you can get this effect via XDoclet, which is what I was referring to.Do you have this project in CVS? Can you just retrieve the web.xml file from source control?
Ok, thanks, I suspected this would be the answer – generating the entry with the wizard is fine if you do not refactor any servlets, which is what I did, and stuffed the web.xml file!
I guess I can cut and paste the code, delete and recreate all the servlets or restore from backup as you suggest *sigh*
Cheers
Chris
Riyad KallaMembergenerating the entry with the wizard is fine if you do not refactor any servlets, which is what I did, and stuffed the web.xml file!
When you are refactoring your servlet classes, Eclipse should have asked you about ‘search for textual references’ and if you select that, it will do the replacements in your web.xml file for the class names.
I guess I can cut and paste the code, delete and recreate all the servlets or restore from backup as you suggest *sigh*
This sounds like you are creating a lot of work for yourself just to have the wizard generate the servlet entry for you… why not just edit the web.xml file by hand?
Ronald van KuijkMemberThis issue, ‘regenerating the web.xml’, is exactely why I proposed that the servlet wizzard should *not* fill the web.xml but create the approprtiate xdoclet tags in the servlet code and also enable the webdoclet.
-
AuthorPosts