快速搭建动态web工程并且进行数据库交互页面呈现

直接进入主题:

最后注意,勾选

这样工程就基本搭建完成了

打开工程的web.xml文件,

<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>

默认访问的是index.html,所以在WebContent下创建一个简单的index.html文件,再用jboss部署,就访问localhost:8080/Test就可以直接访问了。

我在jboss上部署之后,访问如下:

这样就可以访问静态资源了,但是与数据库进行交互 还是远远不够,别急一步一步来

当我们创建好这个工程之后,只有一个 配置文件 web.xml,web工程启动默认先读取web.xml配置文件,所以才会访问index.html,我们修改也是从web.xml开始

===下次再说

原文地址:https://www.cnblogs.com/qianduanxiaocaij/p/5109983.html