facebook

Regenerating web.xml

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #211284 Reply

    Chris Parsons
    Participant

    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

    #211289 Reply

    Riyad Kalla
    Member

    Chris,
    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.

    #211311 Reply

    Chris Parsons
    Participant

    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

    #211314 Reply

    Riyad Kalla
    Member

    Chris,
    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?

    #211321 Reply

    Chris Parsons
    Participant

    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

    #211322 Reply

    Riyad Kalla
    Member

    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!

    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?

    #211523 Reply

    This 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.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Regenerating web.xml

You must be logged in to post in the forum log in