<?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 " version="2.5"> <display-name></display-name> <welcome-file-list> <welcome-file>SplitPageServlet</welcome-file> </welcome-file-list> <servlet> <servlet-name>ShowViewIndex</servlet-name> <servlet-class>View.ShowViewIndex</servlet-class> </servlet> <servlet-mapping> <servlet-name>ShowViewIndex</servlet-name> <url-pattern>/servlet/ShowViewIndex</url-pattern> </servlet-mapping> <servlet> <servlet-name>SplitPageServlet</servlet-name> <servlet-class>ActionServlet.SplitPageServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>SplitPageServlet</servlet-name> <url-pattern>/servlet/SplitPageServlet</url-pattern> </servlet-mapping> </web-app>
运行结果展示
数据库describe
同时在本次demo中认识到了xml的中使用欢迎界面通过 <welcome-file-list> <welcome-file>静态界面(jsp html)</welcome-file> </welcome-file-list>还可以使用servlet直接用servlet名即可。
初学java和javaee 写一点自己做的东西,代码写的不是很规范,不喜勿喷。