无法在netbeans 7.0.1中找到web.xml [英] Unable to find web.xml in netbeans 7.0.1

查看:196
本文介绍了无法在netbeans 7.0.1中找到web.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将文件上传到服务器,我正在编写一个servlet程序。应该从web.xml中的参数获取文件上传目录的位置。我之前没有使用过web.xml,只知道它为每个servlet创建了条目。我无法在我的web应用程序项目中看到这个文件,我在netbeans中。请帮我解决一下这个。
谢谢。

解决方案

它应位于 YOURPROJECT \web \ WEB -INF 文件夹,因此完整路径为: YOURPROJECT\web\WEB-INF\web.xml






编辑(2015年8月21日)



通过



我决定用一步一步的图片来说明我的答案,以避免任何误解。



我将在Linux(Ubuntu)和Windows(Windows 7)操作系统中说明Netbeans的行为。



Linux:


  1. 让我们用默认设置创建一个简单的Java Web项目。


  1. 我们要去用于检查此文件夹内容的项目文件夹:



注意,那里有 web 文件夹。


  1. 进一步导航:



中的Linux系统上的xml





现在,我们正在导航 YOURPROJECT \web \ WEB-INF \ 文件夹,看看 web.xml 在那里:





对于Windows操作系统,相同的规则是正确的,请检查p ictures如下:







您可以在此处创建web.xml:





或使用Netbeans,如上所述。


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.

解决方案

It should be located in YOURPROJECT\web\WEB-INF folder, so the full path will be: YOURPROJECT\web\WEB-INF\web.xml


EDIT (Aug 21, 2015)

Got a downvote with a comment from duffymo, that my answer is not correct.

And I decided to illustrate my answer with step-by-step pictures to avoid any misunderstanding.

I am going to illustrate Netbeans behaviour in Linux (Ubuntu) and Windows (Windows 7) operating systems.

Linux:

  1. Let's create a simple Java Web project with default settings.

  1. We're going to the project folder to inspect the contents of this folder:

note, that web folder is there.

  1. Navigating further:

You can create a web.xml file in this folder manually or do it using Netbeans via project context menu "New -> Create -> Other":

Now, we're navigating YOURPROJECT\web\WEB-INF\ folder to see, that web.xml is there:

The same rules are correct for windows operating system, check the pictures below:

You can create web.xml here:

or use Netbeans, as I described above.

这篇关于无法在netbeans 7.0.1中找到web.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆