1.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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:*.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
2.在src目录下新建training.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- <context:annotation-config/>-->
<!-- 开启自动扫描包 -->
<context:component-scan base-package="com.deng.controller"></context:component-scan>
<!-- 开启注解驱动 (可不配置)-->
<mvc:annotation-driven/>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/page/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
分享到:
相关推荐
JavaWeb的一种部署方案,包含maven3.3.9+tomcat8.0+eclipse+jdk1.8+ssm配置文件,适合JavaWeb以及SpringMVC架构的初学者
springMVC配置好的环境
SpringMVC一些配置文件的demo
SpringMVC+mybatis环境配置,包括源码和数据库都在内
这是SpringMVC的2019配置,最近需要做一个项目配置的原始环境,可以运行,简单配置的修改,大家应该自己能懂,里面需要的jar包,都存在了,写了一个简单的首页,调用bootstrap,jquery风格,需要的同学,自己下载吧。
结合maven搭建SpringMVC开发环境。 刚导入有错的话在工程上右击-> Java Build Path -> Add Library...-> Server Runtime -> Apache Tomcat -> Finish。 这样就可以了
Spring MVC 全注解配置,吾运行环境:server tomcat8,elcipse,jdk1.8. 注:任何服务器必须是servlet是3.0以上的,否则不能运行,当然也有解决办法,自己百度吧
springmvc+spring+hibernate环境.包括配置文件及cache配置.
Spring 学习笔记《Spring MVC - 环境配置》 https://blog.csdn.net/jx520/article/details/86775325
NULL 博文链接:https://luckylearn.iteye.com/blog/2368510
实现spring mvc 环境配置,代码案例更适合于初学者。
本篇文章主要介绍了SpringMVC如何在生产环境禁用Swagger的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
只有一个页面,关键环节搭配好了,静态资源也配置好了,访问路径:/user/getAll
NULL 博文链接:https://fuaotech.iteye.com/blog/2292707
springMVC+MyBatis集成环境的配置文件
基于springmvc框架搭建的websocket及时聊天,配置了登陆拦截,代码简单易懂,代码基本运行环境是jdk1.7+tomcat,无需配置其他即可使用
这是一个基于eclipse+springmvc+freemarker+注解的入门例子,是一个war包,import到eclipse就应该可以直接运行,但是确保maven环境到存在;我做为一个入门者,是参照了...
ssm框架整合的第三个阶段:完成了springmvc框架的配置和spring框架的配置,配置mybatis环境,将spring、springmvc、mybatis整合到了一起.
Spring+SpringMVC+Mybatis(开发必备技能)01、基础idea环境配置配套编码
6、映入SpringMVC:配置SpringMVC配置信息。-->配置文件:spring-mvc.xml(扫描controller) 7、配置web.xml容器。-->配置文件:web.xml 8、测试三个框架的整合:Maven编译打包部署服务器,测试。