paip.spring3 mvc servlet的配置以及使用最佳实践

1. Web.xml 1

2. springMVC.xml 2

1. mvcAction .mvcAction 2

2. Resin4 发动跟踪mvc maping 3

3. No mapping found for HTTP request with URI 3

1.Web.xml

<servlet>

<servlet-name>spring</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

<init-param>

<param-name>contextConfigLocation</param-name>

<param-value>/WEB-INF/springMVC.xml</param-value>

</init-param>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>spring</servlet-name>  <!-- 这里在配成spring,下边也要写一个名为spring-servlet.xml的文件,主要用来配置它的controller -->

<url-pattern>*.json</url-pattern>

</servlet-mapping>

Xml的位置可以放得个多个地张儿..不过mvc还是放得个web-inf哈面儿好,不用铜布xml...减少部署的问题..

多个文件/WEB-INF/xxx/*.xml

classpath*:/springMVC.xml

作者Attilax 艾龙,  EMAIL:1466519819@qq.com 

来源:老哇的爪子 Attilax 

地址:http://blog.csdn.net/attilax

2.springMVC.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:aop="http://www.springframework.org/schema/aop"

xmlns:tx="http://www.springframework.org/schema/tx"

xmlns:mvc="http://www.springframework.org/schema/mvc"

xmlns:p="http://www.springframework.org/schema/p"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd

http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

<mvc:default-servlet-handler/>

<mvc:annotation-driven />

<context:annotation-config />

<context:component-scan base-package="comapi.**,com.im"/>

<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />

</beans>

1.mvcAction .mvcAction

@Controller

@RequestMapping("/im")   这个参数也能不代了...

public class mvcAction {

@RequestMapping(value = "/list3")

public void searchByKeyword2(String idxf, String keyword, int offset,

int limit, HttpServletResponse response) throws Exception {

response.getWriter().write("json txt");

}

2.Resin4 发动跟踪mvc maping

发动resin的时候儿,能看见所有的生成的map url 了....feobye调试...

3. No mapping found for HTTP request with URI

这个问题是更改孪注解的Url...但是,resin不reload....

只要更改class,biru添加一个方法,就能reload兰...生效兰...

paip.spring3 mvc servlet的配置以及使用最佳实践的更多相关文章

  1. paip.sqlite 管理最好的工具 SQLite Expert 最佳实践总结

    paip.sqlite 管理最好的工具 SQLite Expert 最佳实践总结 一般的管理工具斗可以...就是要是sqlite没正常地关闭哈,有shm跟wal文件..例如ff的place.sqlit ...

  2. paip.前端载入时间分析之道优化最佳实践

    paip.前端载入时间分析之道优化最佳实践 1.另存为 ,查看文件尺寸..和图片. 2.view the 另存为的htm静态的文件单个的载入,看时间...能够排除编程语言的问题and 数据库.. ## ...

  3. 可能是Asp.net Core On host、 docker、kubernetes(K8s) 配置读取的最佳实践

    写在前面 为了不违反广告法,我竭尽全力,不过"最佳实践"确是标题党无疑,如果硬要说的话 只能是个人最佳实践. 问题引出 ​ 可能很多新手都会遇到同样的问题:我要我的Asp.net ...

  4. Spring MVC学习笔记——JSR303介绍及最佳实践

    JSR 303 – Bean Validation 是一个数据验证的规范,2009 年 11 月确定最终方案.2009 年 12 月 Java EE 6 发布,Bean Validation 作为一个 ...

  5. Asp.net MVC 权限过滤器实现方法的最佳实践

    在项目开发中,为了安全.方便地判断用户是否有访问当前资源(Action)的权限,我们一般通过全局过滤器来实现. Asp.net MVC 页面中常见的权限判断使用过滤器主要在以下几种情况(根据权限判断的 ...

  6. atitit.spring3 mvc url配置最佳实践

    atitit.spring3 mvc url配置最佳实践 1. Url-pattern  bp 1 2. 通用星号url pattern的问题 1 3. Other code 1 4. 参考 2 1. ...

  7. 【#】Spring3 MVC 注解(一)---注解基本配置及@controller和 @RequestMapping 常用解释

    Spring3 MVC 注解(一)---注解基本配置及@controller和 @RequestMapping 常用解释 博客分类:  spring MVCSpringWebXMLBean  一:配置 ...

  8. Spring3中的mvc:interceptors标签配置拦截器

    mvc:interceptors 这个标签用于注册一个自定义拦截器或者是WebRequestInterceptors. 可以通过定义URL来进行路径请求拦截,可以做到较为细粒度的拦截控制. 例如在配置 ...

  9. [转]Spring3 MVC + jQuery easyUI 做的ajax版本用户管理

    原文地址:http://www.iteye.com/topic/1081739 上周写了篇基于spring3.0.5 mvc 简单用户管理实例 ( http://www.iteye.com/topic ...

随机推荐

  1. Spring 通过FactoryBean配置Bean

    1.实现FactoryBean接口 import org.springframework.beans.factory.FactoryBean; public class CarFactoryBean ...

  2. Android自定义ImageView实现图片圆形 ,椭圆和矩形圆角显示

    Android中的ImageView只能显示矩形的图片,为了用户体验更多,Android实现圆角矩形,圆形或者椭圆等图形,一般通过自定义ImageView来实现,首先获取到图片的Bitmap,然后通过 ...

  3. iOS9的新特性以及适配方案

    新的iOS 9系统比iOS8更稳定,功能更全面,而且还更加开放.iOS 9加入了更多的新功能,包括更加智能的Siri,新加入的省电模式.iOS 9为开发者提供5000个全新的API. 1. 限制HTT ...

  4. 《机器学习实战》学习笔记——第13章 PCA

    1. 降维技术 1.1 降维的必要性 1. 多重共线性--预测变量之间相互关联.多重共线性会导致解空间的不稳定,从而可能导致结果的不连贯.2. 高维空间本身具有稀疏性.一维正态分布有68%的值落于正负 ...

  5. DevOps的修炼之路!

    作为一名产品经理,首先要知道产品对于所属公司来说意味着什么,要探寻这个问题,我们又得知道和公司息息相关的是什么,在我的理解来看,与公司状况相关的因素有以下这些: 市场份额 平均订单金额 盈利能力 资产 ...

  6. topsort | | jzoj[1226] | | NOIP2003神经网络

    今天终于通过了那道永远都看不懂题目的神经网络... 所谓拓扑排序,就是在有向无环图中,根据已经有的点和点之间的关系进行排序 引用jzyz教材上的栗子:比如说奶牛比较食量大小,我现在拿到的是cow[i] ...

  7. jquery attr()方法 添加,修改,获取对象的属性值。

    jquery attr()方法 添加,修改,获取对象的属性值. jquery中用attr()方法来获取和设置元素属性,attr是attribute(属性)的缩写,在jQuery DOM操作中会经常用到 ...

  8. AutoResetEvent waitone set进一步理解补充

    AutoResetEvent 的定义 //定义两个信号锁 AutoResetEvent ReadTxt = new AutoResetEvent(false); AutoResetEvent Uplo ...

  9. 2016/9/21 leetcode 解题笔记 395.Longest Substring with At Least K Repeating Characters

    Find the length of the longest substring T of a given string (consists of lowercase letters only) su ...

  10. com.alibaba.fastjson.JSONObject学习

    JSONObject json = new JSONObject(); //设置json属性,可以是对象,数值 json.put("key",value); //获取json的普通 ...