【Java】Eclipse手动生成JavaWeb项目web.xml文件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/o0DarkNessYY0o/article/details/52579408

      刚刚在写个栗子Demo的时候,写到一半!!!发现又双叒叕忘记在生成项目的时候勾选自动生成web.xml,很苦恼,不过翻了翻设置神马的居然找到了!赶紧的记录下来,方便大家!

      问题的来源呢~很犯贱的这一个!经常忘记点next导致没够在生成项目的时候勾选”Generate web.xml deployment descriptor(生成web.xml部署描述文件)”选项:

问题描述

      这就是万恶的来源,于是呢,重写的方法很简单,那就是重新创建一个项目再把写的东西拷贝过来咯~

      哈哈,这么坑爹的事儿肯定是开玩笑的啦,下面讲真格的啦!看图!!

解决方案

      点击JavaEE工具下”generate deployment descriptor stub(生成部署描述文件)”以后,于是乎,我们的web.xml就如期和我们见面了!

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>JavaJSPMessageTest</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

      还是这个熟悉的内容,哈哈~说明咱成功了!希望这能够帮助大家从拷贝中解放出来,谢谢大家~

猜你喜欢

转载自blog.csdn.net/o0DarkNessYY0o/article/details/52579408
今日推荐