Unable to find web.xml in netbeans 7.0.1

43,103

Solution 1

I know it's so late but I had the same problem, so here's the solution below:

To create web.xml:

  1. Right click on your project
  2. Choose New
  3. Choose Other
  4. Box New file is opened, in Filter search web.xml
  5. You will get the file you want web.xml, then click next...then finish

(Tested on Netbean 7.4 JDK 7)

Solution 2

web.xml is optional in Java EE 6. So, by default it is not loaded in Netbeans. You need to manually load web.xml from Netbeans.

Solution 3

You need to firstly create a servlet page then web.xml will be generated in WEB.INF/

Solution 4

Try to right click the project and select New -> Other-> Web -> Standard Deployment Descriptor (web.xml) -> Next -> Finish. Follow that and it will be created in Configuration Files.

Video tutorial: https://www.youtube.com/watch?v=UAMOeHtPwrc

Share:
43,103
Saumyaraj
Author by

Saumyaraj

Updated on December 29, 2020

Comments

  • Saumyaraj
    Saumyaraj over 3 years

    I want to upload a file to a server, for which I am writing a servlet program.The location of the directory where the document would be uploaded should be fetched from a parameter in web.xml. I have not use web.xml before and only know that it makes entries for each servlet. I am not able to see this file in my web application project that i am making in netbeans. Please help me with this. Thank you.

  • Saumyaraj
    Saumyaraj over 10 years
    then how to add a context if i don't have web.xml
  • Saumyaraj
    Saumyaraj over 10 years
    The problem is there is no web.xml in my WEB-INF
  • duffymo
    duffymo over 10 years
    You have to open a text editor, create a new file named "web.xml", and add what's necessary.
  • Thufir
    Thufir over 9 years
    hmm, if it's optional, what's the alternative approach?