springmvc.xml的基本配置
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 配置handler -->
<bean id="goodslist1" name="/queryGood_test.action" class="ssm.controller.GoodsController1"/>
<bean id="goodslist3" class="ssm.controller.GoodsController2"/>
<!-- 扫描controller包 -->
<context:component-scan base-package="ssm.controller"></context:component-scan>
<!-- 处理器映射器 非注解的映射器-->
<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/queryGood1.action">goodslist1</prop>
<prop key="/queryGood2.action">goodslist1</prop>
<prop key="/queryGood3.action">goodslist3</prop>
</props>
</property>
</bean>
<!-- 注解映射器 -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
<!-- 处理器适配器 所有的适配器都实现handlerAdapter接口-->
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>
<bean class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter"/>
<!-- 注解适配器 -->
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/>
<bean class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter"/>
<!-- 注解适配器和映射器 -->
<!-- <mvc:annoation></mvc:annoation> -->
<!-- 视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/goods/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>
springmvc.xml的基本配置的更多相关文章
- spring-mvc.xml中的配置
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- spring-mvc.xml的定时器配置
<!-- 设置时间 --> <bean id="myJobTrigger" class="org.springframework.scheduling. ...
- SpringMVC-核心配置文件spring-mvc.xml
@Spring-MVC.xml @MVC的注解驱动 Bean模式 上面源码的配置我们看到了,其中映射器和适配器的注解模式是过时的所以我们需要重新配置一下. <!-- 配置处理器映射器 --> ...
- springmvc在web.xml中的配置
<!-- SpringMVC核心分发器 --> <servlet> <servlet-name>dispatcherServlet</servlet-name ...
- SpringMVC、SpringMVC XML配置(纯XML方式)
1.引入SrpingMVC所使用的Java包: cglib-nodep-2.1_3.jar.commons-logging.jar.spring-aspects-4.1.7.RELEASE.jar.s ...
- springmvc访问静态资源的springmvc.xml配置
一. 问题及需求 由于Spring MVC的web.xml文件中关于DispatcherServlet拦截url的配置为"/",拦截了所有的请求,同时*.js,*.jpg等静态资源 ...
- springmvc.xml和applicationContext.xml配置的特点
1:springmvc.xml配置要点 一般它主要配置Controller的组件扫描器和视图解析器 下为:springmvc.xml文件 <?xml version="1.0" ...
- spring 和springmvc 在 web.xml中的配置
(1)问题:如何在Web项目中配置Spring的IoC容器? 答:如果需要在Web项目中使用Spring的IoC容器,可以在Web项目配置文件web.xml中做出如下配置: <!-- Sprin ...
- spring-mvc.xml 和 application-context.xml的配置与深入理解
在java框架这个话题,前几篇文章是基于搭建ssm项目框架,以及web.xml的配置讲解,本篇主要就ssm框架的其他配置文件进行深入讲解,他们分别是:1.application-context.xml ...
随机推荐
- spring.net 框架分析(三)ContextRegistry.GetContext()
我们通过ContextRegistry.GetContext()建立了一个IApplicationContext得实例,那么这个实例具体是怎么建立的了. 我们来分析一下容器实例建立的过程: 我们在配置 ...
- [LeetCode] Word Pattern 词语模式
Given a pattern and a string str, find if str follows the same pattern. Examples: pattern = "ab ...
- _web基础_servlet基础
一.了解Servlet的概念 Servlet定义:Servlet是基于Java技术的Web组件,由容器管理并产生动态的内容.Servlet引擎作为WEB服务器的扩展提供支持Servlet的功能.Ser ...
- WebAPI中无法获取Session对象的解决办法
在MVC的WebApi中默认是没有开启Session会话支持的.需要在Global中重写Init方法来指定会话需要支持的类型 public override void Init() { PostAut ...
- JQuery选择器
动态修改样式 $("#div1").attr("display","block"); //有问题 $("#div1"). ...
- h5面试题集合
一.闭包的理解: 使用闭包主要是为了设计私有的方法和变量.闭包的优点是可以避免全局变量的污染,缺点是闭包会常驻内存,会增大内存使用量,使用不当很容易造成内存泄露. 闭包三个特性: 1.函数嵌套函数 ; ...
- jdk 环境变量配置
环境变量:Path %JAVA_HOME%\bin;%JAVA_HOME%\jre\binCLASSPATH .;%JAVA_HOME%\lib;JAVA_HOME D:\java\jdk1.5.0_ ...
- 事件DOMContentLoaded和load的区别
1.当 onload 事件触发时,页面上所有的DOM,样式表,脚本,图片,flash都已经加载完成了. 2.当 DOMContentLoaded 事件触发时,仅当DOM加载完成,不包括样式表,图片,f ...
- 疯狂JAVA16课之对象与内存控制
java内存管理分为两个方面:内存分配和内存回收.这里的内存分配特指创建java对象时JVM为该对象在对内存中所分配的内存空间.内存回收指的是当该java对象失去引用,变成垃圾时,JVM的垃圾回收机制 ...
- ASP.NET Forms 身份验证
ASP.NET Forms 身份验证 在开发过程中,我们需要做的事情包括: 1. 在 web.config 中设置 Forms 身份验证相关参数.2. 创建登录页. 登录页中的操作包括: 1. 验证用 ...