Servlet對應(yīng)的web.xml在哪打開
用的是2016Myeclipse,創(chuàng)建了一個(gè)Servlet,可是在WEB-INF→lib沒有對應(yīng)的web.xml文件,想知道在哪里打開對應(yīng)的web.xml文件。
用的是2016Myeclipse,創(chuàng)建了一個(gè)Servlet,可是在WEB-INF→lib沒有對應(yīng)的web.xml文件,想知道在哪里打開對應(yīng)的web.xml文件。
2018-03-18
舉報(bào)
2018-03-19
我的意思是, 如果沒有這個(gè)xml 就自己創(chuàng)建, 這個(gè)問題不大, 至于xml 文件前面有兩句聲明,?
以下是一個(gè)空的 xml? 模板, 去已有的其他xml 文檔里面復(fù)制都是一樣的
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
? <display-name>demo</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>
2018-03-18
手動(dòng)在 WEB-INF 文件夾下創(chuàng)建 web.xml 文件.
至于模板,可以去 tomcat 安裝目錄下面的 conf/web.xml 下面復(fù)制內(nèi)容, 然后刪掉注釋以及無關(guān)內(nèi)容
自己再配置就行了
不過 好像創(chuàng)建servlet 的時(shí)候 myeclipse 有個(gè)提示框 (生成 web.xml) 你應(yīng)該是忘記勾選了