关联服务器,还要下载tomcat服务器
windows-->Preference-->service-->Runtime Enviroment-->add
new Dynamic Web Project-->Target runtime
service-->add
使用sts开发web项目,引入七个架包,放在WEB-INF->lib中
spring-web.jar提供监听器,

在Web启动的时候,采用监听器,实例化SpringIOC容器,
但spring-web-4.3.9.RELEASE架包中已经有监听器了,直接在web.xml中配置就可以了
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
将项目添加到服务器中,启动服务器,没有报错,就说明成功了
本文介绍如何在Spring Tool Suite(STS)中创建Web项目,包括配置Tomcat服务器、添加Spring框架依赖以及通过监听器实例化Spring IOC容器的方法。详细步骤涵盖了环境设置、项目创建、依赖引入及服务器配置。
1213

被折叠的 条评论
为什么被折叠?



