Spring MVC前端参数映射问题 [问题点数:40分,结帖人Cui_xing_tian]

Bbs1
本版专家分:0
Blank
GitHub 绑定GitHub第三方账户获取
结帖率 100%
Bbs5
本版专家分:2358
版主
Blank
GitHub 绑定GitHub第三方账户获取
Blank
优秀版主 2015年8月优秀小版主
2015年5月优秀小版主
2015年4月html5优秀版主
Blank
蓝花 2015年7月 Web 开发大版内专家分月排行榜第三
Bbs1
本版专家分:40
Bbs1
本版专家分:10
Bbs2
本版专家分:105
springMVC中前端将传递数据传递到后端后端的接收方式(转)
转:https://blog.csdn.net/m0_37601318/article/details/78261144 侯大哥 内容如下: 前提:<em>spring</em><em>mvc</em>可以自动将json数据转化为Java对象,而将对象转化为json数据,必须在配置文件中配置!,需要注解@responseBody,需要json包 在Java中,<em>前端</em>传递数据的方式是&amp;lt;from&amp;gt;标签&amp;lt;input&amp;...
spring mvc 映射问题
[img=https://img-bbs.csdn.net/upload/201310/29/1383016626_782597.jpg][/img]rnrn<em>映射</em>的路径中在web-inf前面多出了功成名。哪位遇到过。rn @RequestMapping("/index")rn public ModelAndView test()rn ModelAndView mav = new ModelAndView("shouimage");rn return mav;rn rnrnrn注解的配置rnrn rn rn rn rn rn rn
spring MVC 映射问题
[img=https://img-bbs.csdn.net/upload/201608/06/1470489947_55913.jpg][/img]rn[size=24px][b]如图,我想让url为/admin/article 时<em>映射</em>到这个save方法,但是却返回404rnrn如果把save方法上mapping改为“/save” ,这样能使url为/admin/article/save <em>映射</em>到这个方法上,但是这样不再是RESTful风格了rnrn请教怎么让url 为/admin/article 时能<em>映射</em>到save方法,且符合RESTful风格[/b][/size]
Spring mvc路径映射问题
http://localhost:8080/TestServlet/testing/joe.bloggs@example.com @RequestMapping(value = &quot;/{email}&quot;, method = RequestMethod.GET) @RequestMapping(value = &quot;/{email:.*}&quot;, method = RequestMethod.GET)/...
Spring MVC无法映射问题
今天写C层遇到了这个<em>问题</em>,Ambiguous mapping found. Cannot map 'basicInfoContorller' bean method 后来发现是因为这个Controller里边的一个@RequestMapping()方法名称跟另一个Controller里的@RequestMapping()方法重名了,建议在方法名称前再加一个名称/user/updateUser,这
关于spring mvc映射问题
本人新学<em>spring</em> <em>mvc</em>。最近做个小demo遇到一个<em>问题</em>很是不解。先上 代码rnweb.xmlrnrnrnrn rn <em>spring</em>MVCrn org.<em>spring</em>framework.web.servlet.DispatcherServletrn rn contextConfigLocationrn WEB-INF/<em>spring</em>-servlet.xmlrn rn 1rn rn rn <em>spring</em>MVCrn /rn rn rnrnrnrnrnrnrn<em>spring</em>-servlet.xmlrnrnrnrn rnrnrnrn rnrnrnrnrnrnrn rn rn rnrnrnrnrnrnrncontroller:rnrnpackage com.huyang.<em>spring</em>;rnimport javax.servlet.http.HttpServletRequest;rnrnrnimport javax.servlet.http.HttpServletResponse;rnrnrnrnimport org.<em>spring</em>framework.web.bind.annotation.RequestMapping;rnimport org.<em>spring</em>framework.web.servlet.ModelAndView;rnimport org.<em>spring</em>framework.web.servlet.<em>mvc</em>.Controller;rnrn//@org.<em>spring</em>framework.stereotype.Controllerrnpublic class HelloWorldController implements Controller rnrn //@RequestMapping("/hello")rn public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse resp) throws Exception rn //1、收集<em>参数</em>、验证<em>参数</em>rn //2、绑定<em>参数</em>到命令对象rn //3、将命令对象传入业务对象进行业务处理rn //4、选择下一个页面rn ModelAndView mv = new ModelAndView();rn //添加模型数据 可以是任意的POJO对象rn mv.addObject("message", "Hello World!");rn //设置逻辑视图名,视图解析器会根据该名字解析到具体的视图页面rn mv.setViewName("hello");rn System.out.println("have enter int ocontroller");rn return mv;rn rnrn为什么访问http://localhost:8080/SpringMVC/hello.jsp显示的不对,而http://localhost:8080/SpringMVC/hello才显示对呢?求大神分析。感激不尽
springMVC接口接受前端传递参数数据类型总结
最近项目中处理前台数据时突然发现比较模糊这些概念,所以总结如下: 目录 一、<em>spring</em>MVC中controller<em>参数</em>是自动注入 二、 接受<em>前端</em>传递的对象 1、从querystring中的<em>参数</em>中获取: 2、从请求体(body)中获取(及获取对象数据) 3、接收<em>前端</em>传递的数组 三、总结 一、<em>spring</em>MVC中controller<em>参数</em>是自动注入 在<em>spring</em>MVC中,contr...
Spring MVC 如何接收前端各种参数
Spring MVC在接收集合请求<em>参数</em>时,需要在Controller方法的集合<em>参数</em>里前添加@RequestBody,而@RequestBody默认接收的enctype (MIME编码)是application/json,因此发送POST请求时需要设置请求报文头信息,并且传值必须JSON.stringify转为json字符串,否则Spring MVC在解析集合请求<em>参数</em>时不会自动的转换成JSO
Spring MVC 映射处理器
概述Spring MVC三个<em>映射</em>处理器: BeanNameUrlHandlerMapping ControllerClassNameHandlerMapping SimpleUrlHandlerMapping 详细使用可以参考 易百教程 » Spring MVC控制器类名称处理<em>映射</em> 我主要想介绍一些,如果三个<em>映射</em>处理器一起使用,包括和开启Annotation功能的时候框架是如何处理的。
Spring MVC的静态资源映射
一 点睛 Spring MVC的定制配置需要配置类继承WebMvcConfigurerAdapter类,并在此类使用@EnableWebMvc,来开启对Spring MVC的配置支持,这样就可以重写这个类的方法,完成常用的配置。 程序的静态文件(js、css、图片)等需要直接访问,这时可以在配置文件中重写addResourceHandlers方法来实现、 二 实战 1 添加资源文件 在s...
初学Spring MVC的映射
初学Spring MVC的<em>映射</em> 首先我们新建一个web项目 1、在lib目录添加<em>spring</em>所需的jar包 2、编写<em>spring</em><em>mvc</em>-config.xml文件: &lt;?xml version="1.0" encoding="UTF-8"?&gt; beans xmlns=“http://www.<em>spring</em>framework.org/schema/beans” xmlns:context=...
Spring mvc 的静态资源映射
访问资源报404的话,原因是静态资源被<em>spring</em> <em>mvc</em>的dispatcher servlet拦截。 解决办法:加入静态资源<em>映射</em>的配置:(以图片资源为例) &amp;lt;<em>mvc</em>:resources mapping=&quot;/images/**&quot; location=&quot;/images/&quot; /&amp;gt; ...
spring mvc 接受参数问题
一、SpringMVC<em>参数</em>绑定(从请求中接受<em>参数</em>)二、Spring<em>mvc</em>之接受请求<em>参数</em>三、【Spring】详解Spring MVC中不同格式的POST请求<em>参数</em>的数据类型转换过程四、<em>spring</em>Mvc--接受日期类型<em>参数</em>处理五、<em>spring</em>拾遗(三)——用map接收请求<em>参数</em>的<em>问题</em>解决...
spring mvc 参数传值问题
如上所示:如果在方法里面传递<em>参数</em>,那么它必须得传该字段,字段值可以空,否则会报错,如果使用request取值的话就不用必须传,上面第二个param那个是index 不是dlzh
请教spring mvc 参数问题
@Controllerrnpublic class BaseController rn@RequestMapping("/base")rn @ResponseBodyrn public Object delete(OptionData data) rn return baseService.update(data); rnrn rnrnrnpublic class OptionData rnrnprivate string id;rnprivate string name;rnprivate HttpSession session; rnrnrnrn public void setId(String id) rn this.id= id;rn rnrn public String getId() rn return id;rn rnrn public void setName(String name) rn this.name= name;rn rnrn public String getName() rn return name;rn rn public String getSession() rn return session;rn rn public void setSession(HttpSession session) rn this.session = session;rn rnrn请教, public Object delete(OptionData data) rn return baseService.update(data); rnrn 中,OptionData 里Sessoin怎么能自动取到值
spring mvc映射默认路径
使用环境:<em>spring</em> <em>mvc</em> 3.02rn<em>问题</em>:rn我使用ControllerClassNameHandlerMapping做为<em>映射</em>rnrn现在是我的类rn[code=Java]rn@Controllerrn@RequestMappingrnpublic class LuDianController rnrn @RequestMappingrn public ModelAndView query() rn ModelAndView mav=new ModelAndView("/ludian/query");rn return mav;rn rn rn @RequestMappingrn public ModelAndView update() rn ModelAndView mav=new ModelAndView("/ludian/update");rn return mav;rn rnrnrnrnrn[/code]rn如上,现在<em>映射</em>了两人方法,ludian/query和ludian/updatern对应的jsp为WEB-INF下的bdf文件夹下的query.jsp和update.jsprnrn<em>问题</em>是,我在bdf还有许多页面,例如delete.jsp,add.jsp...rn这种情况下我需要一个统一的的方法,<em>映射</em>过去,而不是必须写n个类似的delete方法,add方法...因为这些方法只需要它给我<em>映射</em>一下rnrn目前我想到的是有几个jsp页面,就写几个controller的方法,这绝对不行。。。rnrn求统一的方法,在LudianController写 一个方法,剩余的jsp全走那个,然后自动<em>映射</em>到对应的jsprnrn求教!
SpringMVC------handlerMapping
一.根据bean name访问     如果不配置<em>映射</em>处理器会采用默认的<em>映射</em>处理器BeanNameHandlerMapping     下面可以通过:http://localhost:8080/<em>spring</em><em>mvc</em>/hello.do来访问       bean     class="org.<em>spring</em>framework.web.s
Spring MVC的参数封装
关于List和数组的<em>参数</em>封装content-type为application/x-www-form-urlencoded; charset=UTF-8:如果提交的数格式是 ids[]=1&amp;amp;ids[]=2&amp;amp;ids后台接收方式:1public ModelAndView search(@RequestParam(&quot;ids[]&quot;) Long[] impIdList){ Model...
spring mvc 参数封装
请看这个<em>问题</em>。也许我们会说:通过写vo来解决。确实,使用vo可以很好地解决<em>spring</em> <em>mvc</em>的<em>参数</em>封装的<em>问题</em>,而且,开发者写vo是一个好的习惯(我是一个懒人,如非必要很少写。。。)。 然而,我遇到另一个类似的<em>问题</em>。   请求方法如下: @RequestMapping(value=&quot;/admin/website/delete/{id}&quot;,method=RequestMethod.POST)...
Spring MVC接收参数
五.SpringMVC接收<em>参数</em>1. 和ServletAPI紧耦方法(使用原生ServletAPI)1.1 SpringMVC会对所有控制器方法<em>参数</em>进行注入.如果能注入就注入,不能注入不注入.@RequestMapping(&quot;demo&quot;)public String demo(HttpServletRequest request){System.out.println(request.getParam...
Spring MVC参数处理
使用Servlet API作为<em>参数</em> HttpServletRequest HttpServletResponse HttpSession 使用流作为<em>参数</em> 总结Spring MVC通过分析处理处理方法签名,将HTTP请求信息自动绑定到处理方法的<em>参数</em>中。@RequestMapping : 获取前台传递的<em>参数</em> @RequestMapping("/p1") public String par
Spring MVC 参数校验
在Java web开发过程中,经常需要从<em>前端</em>获取<em>参数</em>到服务端,服务端预设的变量接收的值可能为正确的值,也可能是空字符串或者是null。对于变量接收的值,我们希望能够在接收值的时候进行控制,而不是在代码中处理的时候报各种奇怪的错误。 方法一:在控制层中对于接收<em>参数</em>添加@RequestParam 举个栗子: @RestController @RequestMapping("/v1") pub
Spring mvc参数类型转换
1,需求 有时候我们接收到的<em>参数</em>为String类型的,但是我们需要将它们转化为其他类型的如:date类型,枚举类型等等,<em>spring</em> <em>mvc</em>为我们提供了这样的功能。 2,配置文件 在<em>spring</em><em>mvc</em>.xml配置文件中添加如下代码: &lt;<em>mvc</em>:annotation-driven conversion-service="conversionService...
ASP.NET MVC操作参数映射问题
ASP.NET MVC的模型联编程序能够将HTTP请求体<em>映射</em>为操作方法的<em>参数</em>,那么对于层次数据该如何处理呢?rn例如下面的类结构:rnpublic class A rn public int ID rn get;rn set;rn rn rn public ICollection Datarn get;rn set;rn rnrnrnpublic class B rn public int ID rn get;rn set;rn rnrnrn操作方法代码如下:rnpublic ActionResult ProcessA(A info) rn //处理info的代码rnrnrn如何构造HTTP请求,使MVC能够自动为info<em>参数</em>获取到正确的数据呢?rnrn分不多,希望和大家一起讨论讨论 [img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/19.gif][/img]
关于Spring MVC 路径映射问题
配置:rnrn[code=XML]rnrnrnrnrnrnrnrnrnrn[/code]rnrn代码:rn[code=Java]rn@Controllerrnpublic class UserTypeController rnrn@Resourcernprivate UserTypeService userTypeService;rnrn@RequestMappingrnpublic List list() rnreturn userTypeService.geAll();rnrnrn@RequestMapping("/input/id")rnpublic String input(@PathVariable("id") int id,Model model) rnmodel.addAttribute(userTypeService.getByAutoId(id));rnreturn "userType/input";rnrn[/code]rnrn测试:rnrn1.http://localhost:10123/userType/list.do 没有<em>问题</em>rnrn2.http://localhost:10123/userType/input/3.do 出错:rn2011-9-22 20:37:11 org.<em>spring</em>framework.web.servlet.DispatcherServlet noHandlerFoundrn警告: No mapping found for HTTP request with URI [/userType/input/3.do] in DispatcherServlet with name 'SpringMVC'rnrnrn请问何故,请激扬文字! 盼君多复!rn
spring mvc前端ajax通信
解决ajax跨域操作ajax与<em>spring</em>通信中,json字符串和js对象及java对象之间的转化。 <em>前端</em>和后端分离是一种趋势,但<em>前端</em>和后端的通信,其实大多由ajax来承担。 <em>spring</em> <em>mvc</em> 中,由ajax 传递来的json字符串,在本文中用的是<em>spring</em> <em>mvc</em>的注解:@RequestBody来解析成java对象。 <em>spring</em>中返回的对象,自动传递给<em>前端</em>jso
spring mvc前端验证代码生成器
未完
Spring MVC配置前端控制器
&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java...
spring mvc参数接受的各种方式
<em>spring</em> <em>mvc</em>在和<em>前端</em>交互过程中,最重要的任务之一就是和<em>前端</em>交互,交互过程中我们不可避免的需要接受用户在<em>前端</em>需要传递给后端的<em>参数</em>,那我们总结一下各种接受<em>前端</em><em>参数</em>的方式 1:通过<em>前端</em>URL地址栏中的<em>参数</em>接受(restful风格接收主要用到) /** * 通过路径接受 * * @param name * @return * @throws Exception */ @...
spring mvc 参数注入的流程
RequestMappingHandlerAdapter中注册了很多<em>参数</em>解析的解析器,在方法getDefaultArgumentResolvers中可以查看到 这是本次测试的函数: public Map&amp;lt;String, Object&amp;gt; get(HttpServletRequest request, @RequestParam(name = &quot;qwe&quot;) String qwe) ...
Spring MVC 参数字段校验
Spring MVC <em>参数</em>字段校验Spring MVC <em>参数</em>字段校验 校验规范 内置规则汇总 自定义校验规则 实际使用介绍 引入JAR包 基本使用介绍 结合RequestBody的使用介绍校验规范 SR-303 是JAVA EE 6 中的一项子规范,叫做Bean Validation,官方参考实现是Hibernate Validator。JSR 303 用于对Java Bean 中的字段的值进行
spring mvc自定义参数解析器
<em>参数</em>解析器 1. <em>参数</em>解析器是<em>spring</em> <em>mvc</em>中将请求上下文中的请求<em>参数</em>转化要被调用的请求方法的<em>参数</em>的<em>参数</em>值。 2. <em>参数</em>解析器的初始化是在Handler适配器中。 3. <em>spring</em> <em>mvc</em>默认的<em>参数</em>解析器有20多个,大概分为以下4类,这个是RequestMappingHandlerAdapter类里初始化设置HandlerMethodArgumentResolverComposite...
Spring MVC 实现原理和注入参数
SpringMVC的实现原理 1. 客户端发送请求,提交到DispatcherServlet控制器 2. DispatcherServlet控制器查询HandlerMapping(处理器<em>映射</em>) 3. HandlerMapping查找控制层Controller 4. 控制层调用业务层处理请求并返回结果 5. DispatcherServlet控制器根据结果查询视图解析器将结果展现给页面 Sprin...
Spring MVC 三种参数注入
[code=&quot;xml&quot;][/code] 1)<em>参数</em>注入第一种方法 [code=&quot;xml&quot;] [/code] [code=&quot;java&quot;] private XmlWriteService xmlWriteService; @Override public void init() throws ServletException { super.init(); xm...
Spring MVC参数的传递与接收
SpringMVC主要做的就两方面的操作。 在Controller接收从jsp传递过来的数据 把Controller的数据传递到jsp页面
spring mvc 之可选路径参数
在<em>spring</em> <em>mvc</em>中,注解@PathVariable可以获得路径<em>参数</em>,但如果我想让路径<em>参数</em>可选呢? @GetMapping({"/get/{offset}/{count}","/get/{offset}","/get/{offset}","/get"}) public void getGoods(@PathVariable(required = false) Integer o...
解决Spring MVC 参数乱码问题
1:RequestBody返回中文乱码解决方案 text/plain;charset=UTF-8 text/html;charset=UTF-8
spring mvc接受ajax参数问题
[code=javascript]$.ajax(rn type : 'POST', rn dataType : 'json', rn// data: jsonStr,rn data:rn "zbtz":jsonStr, //对象rn "ggbdGuid":ggbdGuid,rn "isFaChu":true,rn "qmContent":qmContent,rn "qmResult":qmResult,rn )[/code]rnrn控制层rn[code=java]public Object insertTongZhi(@RequestBody DBZhongBiaoJieGuoTongZhi zbtz,@RequestParam(value ="ggbdGuid") String ggbdGuid,@RequestParam(value ="isFaChu"){}[/code]rnrn如果这样写报415 (Unsupported Media Type)错误,如果在ajax中加上contentType : 'application/json', 报400错误,rnrn如果[code=javascript]$.ajax(rn type : 'POST', rn dataType : 'json', rn contentType : 'application/json', rn data: jsonStr,rn )[/code]rn在控制层接受[code=java]public Object insertTongZhi(@RequestBody DBZhongBiaoJieGuoTongZhi zbtz)[/code]rn或rn[code=javascript]$.ajax(rn type : 'POST', rn dataType : 'json', rn data:rn "ggbdGuid":ggbdGuid,rn "isFaChu":true,rn "qmContent":qmContent,rn "qmResult":qmResult,rn )[/code]rn在控制层接受[code=java]public Object insertTongZhi(@RequestParam(value ="ggbdGuid") String ggbdGuid,@RequestParam(value ="isFaChu") boolean isFaChu,@RequestParam(value ="qmContent") String qmContent,@RequestParam(value ="qmResult") String qmResult)[/code]rn就正常,rn我想在ajax传多个数据,即可以是对象,也可以是字符串,在控制层同时用@RequestBody和@RequestParam同时接受,请问该怎么实现呢
Spring MVC 传入List参数的接收问题
帖一个歪果仁的解决方案,测试没有<em>问题</em>。建议使用此方式。 Here is the code that works for me. The key is that you need a wrapper class. public class Person { private String name; private Integer age; public
spring mvc接收对象参数问题
class BankArrayrn private Bank banks[] ;rnrn public void setBanks(Bank[] banks) rnthis.banks = banks;rn rnrn public Bank[] getBanks() rn return banks;rn rnrnrn//用 BankArray 作<em>参数</em>rn@RequestMapping(value ="xxx" , method = RequestMethod.POST)rnpublic ModelAndView doLogOut(BankArray param) rnrn/* 页面用下面的方式 */rnrnrnrnrnrnrnrn rnrn当数组个数大于256时,报错如下:rnrnorg.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet dispatcher threw exceptionrnjava.lang.IndexOutOfBoundsException: Index: 256, Size: 256rn at java.util.ArrayList.RangeCheck(ArrayList.java:547)rn at java.util.ArrayList.get(ArrayList.java:322)rn at org.<em>spring</em>framework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:793)rn at org.<em>spring</em>framework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:576)rn at org.<em>spring</em>framework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:553)rn at org.<em>spring</em>framework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:914)rn at org.<em>spring</em>framework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)rn at org.<em>spring</em>framework.validation.DataBinder.applyPropertyValues(DataBinder.java:692)rn at org.<em>spring</em>framework.validation.DataBinder.doBind(DataBinder.java:588)rn at org.<em>spring</em>framework.web.bind.WebDataBinder.doBind(WebDataBinder.java:191)rn at org.<em>spring</em>framework.web.bind.ServletRequestDataBinder.bind(ServletRequestDataBinder.java:112)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker.doBind(AnnotationMethodHandlerAdapter.java:797)rn at org.<em>spring</em>framework.web.bind.annotation.support.HandlerMethodInvoker.doBind(HandlerMethodInvoker.java:813)rn at org.<em>spring</em>framework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:367)rn at org.<em>spring</em>framework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:439)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:427)rn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)rn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:822)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.<em>spring</em>framework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.<em>spring</em>framework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)rn at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1774)rn at java.lang.Thread.run(Thread.java:662)
问个spring mvc回传json参数问题
control里的方法大概是这样的rn public Map login(User user)rnrn 现在的<em>问题</em>是:返回json字符串的时候,login的<em>参数</em>user即使是null也会返回一个json字符串。rn请问怎么去掉。
asp.net mvc参数映射,返回404了
访问http://localhost:2797正常rn访问http://localhost:2797/1错误,提示404了rnroutes配置是rn routes.MapRoute(rn name: "Default",rn url: "controller/action/id",rn defaults: new controller = "Account", action = "Login", id = UrlParameter.Optional rn );rn与不知道错在哪里了?请多多指教,谢谢了
Spring MVC中静态资源映射配置
因公司项目的需要使用<em>spring</em> MVC框架 ,于是就开始学习SpringMVC的使用.废话不多说直接切入正题. 开发工具: Spring Tool Suite 一款专用于<em>spring</em>项目开发的IDE; 直接上配置:     首先引入<em>spring</em> MVC 依赖的jar包,或是使用Maven构建项目在pom文件中添加如下依赖: 1.6 3.1.1.RELEASE 1.6.1
spring mvc 方法映射原理解析(二)
1.源码版本<em>spring</em>-<em>mvc</em> 4.3.92.回顾通过源码分析一可以看到 , 在DispatcherServlet的doDispatch方法中,有一个很重要的方法,就是通过request获取当前请求的handler , 这个handler就是我们请求的那个方法的封装。 这里主要说一下,<em>spring</em> <em>mvc</em>是如何对Controller进行初始化,以及http请求过来之后,是怎么通过通过请求URL找...
Spring MVC 请求映射源码简析
SpringMVC 采用注解的方式来标识请求的路径,通过数据<em>映射</em>简化业务代码的逻辑,使得业务代码无需直接操作 HttpServletRequest 对象。本 Chat 将以常用的 RequestMap
spring MVC静态资源映射访问不到
<em>spring</em>_<em>mvc</em>.xml中添加 <em>mvc</em>:resources mapping="/css/**" location="/content/css/"/> <em>mvc</em>:resources mapping="/js/**" location="/content/js/"/> <em>mvc</em>:resources mapping="/images/**" location="/content/images/
温故知新 – Spring MVC请求映射RequestMapping
RequestMapping注解说明 @RequestMapping注解的作用将Web请求<em>映射</em>到特定处理程序类和/或处理程序方法,这个注解可以用于类或者方法上,并通过属性value指定请求路径。用在Controller类上表示提供初步的URL请求<em>映射</em>信息,相对于Web应用的根目录,这是一个前置请求路径。用在Controller中方法上,表示提供详细的URL<em>映射</em>。如果Controller类上没有加R...
spring mvc映射入门级学习demo
[url=https://blog.csdn.net/quanaianzj/article/details/78191006][/url]rn[url=https://blog.csdn.net/cw_hello1/article/details/51322652][/url]rn[url=https://www.cnblogs.com/tingbogiu/p/5796199.html][/url]
Spring MVC 请求映射不进对应的方法
本人在使用<em>spring</em> <em>mvc</em>的过程中请求页面可以找到,但是对应的requestMapping方法进不去。求指点rnrn<em>spring</em> <em>mvc</em>配置文件:rn[code=text]rnrn rn rn rn rnrn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn[/code]rnrnrnrn对应的controller:rn[code=java]rnrn@Controllerrn@RequestMapping("/")rnpublic class UsersController rn @Autowiredrn private UsersService usersService;rn public UsersController()rn System.out.println("222");rn rn @RequestMapping(value = "/logon/username/password" ,method=RequestMethod.GET)rn public String login(@RequestParam String username,rn @RequestParam String password, Model model,rn HttpServletRequest request) throws Exception rn System.out.println("111");rn UserInfo userInfo = usersService.getUserByName(username);rn if(userInfo==null)rn model.addAttribute("message", "用户不存在");rn return "logon";rn else if(password == null || !password.equals(userInfo.getUserPassword()))rn model.addAttribute("message", "密码错误");rn return "logon";rn elsern request.getSession().setAttribute(Constants.USER_INFO_SESSION, userInfo);rn return "main";rn rnrnrn rn @RequestMapping("test.html")rn public String doTest(Model model)throws Exceptionrn System.out.println("333");rn return null;rn rnrnrn[/code]rn对应的页面请求:rn[code=html]rn rn 登陆rn rn rn rn rn rn rn rn rnrn[/code]rnrn访问url 页面rnhttp://localhost:8080/HonestSpring/test.htmlrn页面白页,请求发送成功,但是断点没有进入到对应的mapping方法中去rn求大侠指定,在线等
Spring MVC使用篇(六)—— 请求映射
1、综述   Handler处理器在Spring MVC中占据着重要位置,它主要负责请求的处理和结果的返回。在MVC架构中,Handler扮演了控制层(Controller)的角色。 2、Controller   在日常开发中最常用的处理器<em>映射</em>器和适配器是基于注解的处理器<em>映射</em>器和适配器配置,即annotation-driven标签。它会自动注册处理器<em>映射</em>器和处理器适配器,并且除此之外还提供了数据绑...
Spring MVC 概念模型 -- HandlerMapping : 请求/处理器映射
概述 Spring MVC接口HandlerMapping 用于抽象建模概念:请求(request)和处理器(handler)之间的<em>映射</em>关系。 该接口可以由开发者实现,不过这不是必须的。框架自己带了一些实现,比如BeanNameUrlHandlerMapping和RequestMappingHandlerMapping。如果容器中没有注册HandlerMapping bean组件,那么缺省使用的会...
Spring MVC请求映射常见的三种方式
NULL 博文链接:https://xieke90.iteye.com/blog/2235706
Spring MVC 映射Date类型参数的解决方案
在Spring MVC中,无法直接将Date类型的数据<em>映射</em>绑定到Controller方法的<em>参数</em>中,因为Spring本身不支持这种类型的转换,所以这里有两种解决方案供小伙伴儿们参考一下下。 1.自定义格式转换(荐)         在Controller中使用InitBinder(该注解在Spring2.5之后才有)注解来定义如下方法,即可解决Date类型转换<em>问题</em>: /** *
PUT参数映射问题
Before: 1.使用@RequestParam获取表单<em>参数</em> 2.若不加@,可使用<em>映射</em>对象获取所有对应的@RequestParm值   <em>问题</em>: PUT中只能使用@RequestParam获取值 若删除注解使用对象<em>映射</em>,则无法获取到值   原因: 可能是Tomcat对put的默认处理机制决定,可修改web.xml,若不修改,则使用@RequestParam逐个获取<em>参数</em>值...
SpringMVC的参数映射问题
SpringMVC的<em>参数</em><em>映射</em><em>问题</em>:(JSP页面或者说url路径的<em>参数</em>同控制器里的方法的<em>参数</em>的对应) 1)第一种<em>映射</em>方式:    表单里的表单元素的name名字和控制器里的方法的形参名一致。   比如界面中的数据: typeName"/>   在控制器里方法的定义: @RequestMapping(value="/addtype.action")     public void add
spring 的路径映射问题
如题:我在html页面的 ?还是这样写?rnrn这个user对象写与不写 <em>spring</em>控制层会去识别吗 怎么识别 这个“name”是user里的呢?rnrn或许这对于你来说是个简单不过的<em>问题</em> ,但对我这个菜鸟来说你得每一句停留和回答对我来说都很重要 希望路过知道的好心人给讲解下吧,感激不尽!!rn
spring MVC前端返回字符串中文乱码解决方案
<em>spring</em> MVC<em>前端</em>返回字符串中文乱码解决方案 今天项目中遇到一个,后端返回json或者字符串,中文乱码情况,很头疼,<em>spring</em>对中文这块处理不是特别友好。下面分享一个我自己的解决方式,当然有其他人可能有更好的方式。 可以将字符串或者json封装进一个list返回给<em>前端</em>,这样就不会乱码了,网上有好多人推荐配置字符编码设置,但是经过本人尝试,都不起作用;还有人推荐修改spri...
前端JSP与Spring MVC交互实用例子
java前后台交互:html、js、css,在从jsp的方向看,都不过是他生成的字符串而已,在URL<em>参数</em>传递时,只需要把字符串拼接成你想要的就好<em>参数</em>传递与iframe局部刷新 <em>spring</em> <em>mvc</em> 配置为拦截 所有*.do请求 UTF-8
Spring MVC与前端实现JSON交互
原始的Servlet API 在Model2编程时,作为控制器的Servlet交互JSON格式的方法如下 HttpServletRequest request; HttpServletResponse response; /* 获取<em>前端</em>发送的HTTP请求中<em>参数</em>, JSON或者Form表单的都一样(根据name) 获取到的<em>参数</em>类型一定是字符串,要其它类型,需要转化 */ String pa...
spring mvc 获取前端提交的表单
1、前段代码: s_type s_name s_desc s_brand s_price s_image s_from s_edittime 2、后端获取:
Spring MVC 接收前端传递的表单json字符串
Spring MVC 接收<em>前端</em>传递的表单json字符串 初衷 在编写页面表单数据较多,并且很多input来自于循环,没有对应的Pojo类与之<em>映射</em>。 在这种情况下,如果循环不是太多的话可以自己构建一个Pojo对象,然后使用SpringMVC的form标签进行绑定。 但是表单过于复杂后这种方式代码就显得非常臃肿。所以采取在<em>前端</em>页面将表单数据拼接成json字符串,然后传递到controller,
spring mvc 接收前端传入的数组对象
最近弄了一个多图片上传,结果一直出<em>问题</em>,后来发现是接收的数据没有处理好,<em>前端</em>传过来的是一个数组对象,对象里面有一个title的属性,用来放置图片的base64数据,而且数据还包含了data头部,因为<em>spring</em> <em>mvc</em> 不能直接接收数组 和集合,所以,就需要我们进行封装 我现在的做法是,先创建一个实体类,放title属性 public class ImageInfo {          p...
spring mvc前端与后端数据交互的方法
一、<em>前端</em>往后端传递数据(view -&gt; controller) 方式一、 index.jsp: &lt;a href="handler/welcome2/testname"&gt;<em>spring</em> <em>mvc</em> welcome2&lt;/a&gt; servlet(controller层)端接收数据: @RequestMapping(value="welcome2/{name}") ...
前端mvc
讲了些<em>前端</em><em>mvc</em>的知识<em>前端</em>MVC变形记http://web.jobbole.com/84100/怎样深入了解和学习<em>前端</em> MVC 架构?https://www.zhihu.com/question/20135390我对<em>前端</em>MVC的理解https://www.cnblogs.com/macliu/p/5238734.html也许很多人跟我一样对明明几行代码就可以敲出来的,却偏偏要用<em>前端</em><em>mvc</em>很不解。看...
spring boot之spring mvc常用配置-静态资源映射(3)
<em>spring</em> <em>mvc</em>常用配置-静态资源<em>映射</em> <em>spring</em> <em>mvc</em>的定制配置需要我们的配置类集成一个web<em>mvc</em>ConfigurerAdapter类,并在此类使用@EnableWebMvc注解,来 开启对<em>spring</em> <em>mvc</em>的配置支持,这样我们可以重写这个类的方法,完成常用配置。 继承web<em>mvc</em>ConfigurerAdapter 1.静态资源<em>映射</em> 让静态文件(js、css、图片)可以直接
映射参数
<em>映射</em><em>参数</em>
Spring mvc路径映射问题,新娃求解
这是Controller 这是jsp页面 这是web 这是<em>spring</em>_<em>mvc</em>。 这是<em>spring</em>_mybatis 求大佬救命呀!!!!!!!!!拜谢
Spring MVC下,RESTful风格 与 静态资源(static resource)路径映射问题
在使用 Spring 做 REST 接口开发时,大家对配置可能都很熟悉,如下: <em>mvc</em>-dispatch org.<em>spring</em>framework.web.servlet.DispatcherServlet
spring mvc简单问题之实现登录页面到主页面的跳转映射
我现在有两个静态页面login.jsp和major.jspn控制器里代码如下:nnn```n @RequestMapping(value = "/login")n public ModelAndView login(HttpServletRequest request, HttpServletResponse response) throws Exception n Map model = new HashMap();n n return new ModelAndView("login");n n n @RequestMapping(value="/major")n public ModelAndView major()n return new ModelAndView("major");n```n因此可以通过 http://localhost:8080/test/login和nhttp://localhost:8080/test/major分别访问到。nn现在我想通过login.jsp页面中点击一个submit类型的button跳转到major.jsp页面(暂不考虑传值等因素),应该怎样做来实现这两个页面的<em>映射</em>n
spring mvc映射为html后,返回json的奇怪问题
<em>映射</em>为do后缀,返回json到前台,正常。rn[code=html]rnrn <em>spring</em>rn *.dorn rn[/code]rnrn<em>映射</em>为html后缀,返回json到前台,报500错误(程序什么都没有改,就改了RequestMapping的<em>映射</em>名rn[code=html]rnrn <em>spring</em>rn *.dorn rn[/code]rnrnrn方法如下,只改其中的login.do为login.html,什么配置都没有改,ajax调用这个url就不正确了,报http500 error:rn[code=java]rn @RequestMapping(value = "login.do", method = RequestMethod.POST)rn public @ResponseBody Map login(HttpServletRequest request, HttpServletResponse response) rn Map map = new HashMap();rn map.put("msg", user);rnrn return map;rn rn[/code]
Spring MVC JSON格式问题
今天遇到一个<em>问题</em>,很是不解,求各位大婶指点迷津。rn<em>问题</em>处在ajax data 那里。rn平时是这样写的,<em>参数</em>接收是正常的rn[code=javascript]rn$.ajax(rn type: 'POST',rn dataType: 'json',rn contentType : 'application/json',rn data:"loginName":"111","operator":"222","title":"333","beginDate":"444","endDate":"55","status":"1",rn url: t.url.rn success: function(data)rn rn rn); rn[/code]rn后台代码:rn[code=java]rn@ResponseBodyrn@RequestMapping(value="/message/getEmailList")rnpublic EmailDTO getEmailPage(EmailDTO email)rn return msgManagerService.getEmailPage(email);rnrn[/code]rnrn然后感觉每次这样写好麻烦,:"loginName":"111","operator":"222","title":"333","beginDate":"444","endDate":"55","status":"1",rn于是我写了一个方法拼接json的,返回的是一个json格式字符串,json[color=#FF0000]和上面的一模一样的字符串[/color]!!rn下面这样改过以后: 这样后台DTO就接收不到<em>参数</em>了。小弟比较菜,求各位支招。rn[code=javascript]rnvar json = JsonUtils.formToJson('queryForm');rn$.ajax(rn type: 'POST',rn dataType: 'json',rn contentType : 'application/json',rn data:json ,rn url: t.url.rn success: function(data)rn rn rn); rn[/code]rnrn
spring mvc 上传文件问题
先看下我的目录:rn[img=https://img-bbs.csdn.net/upload/201604/26/1461640892_569334.png][/img]rnrn这是我的<em>mvc</em>-dispacher-servlet.xml的内容rn[img=https://img-bbs.csdn.net/upload/201604/26/1461640932_775273.png][/img]rnrn现在<em>问题</em>是只要加入rn[code=html]rn rn rn rn rn[/code]rn就出现错误rn[img=https://img-bbs.csdn.net/upload/201604/26/1461641185_6606.png][/img]rnrn求解。。。
spring mvc 初级问题
RTrnrn@Controllerrn@RequestMapping("/index.htm")rnpublic class Testrn@RequestMapping(params = "method=herfMethod")rnpublic String fromMethod(HttpServletRequest request,rn HttpServletResponse response) throws Exception rn String name = request.getParameter("name");rn String word = request.getParameter("word"); rn request.setAttribute("hello", name+","+word); rn return "index";rnrnrnrn为什么我自己定义的方法,里面放HttpServletRequest request,HttpServletResponse response这两个对象,直接就能拿来用,在这里我还可以用其它的对象吗?是不是注解了@RequestMappin后就能直接用request,response了。rn谢谢!rn
spring mvc 下载问题
这是上传的,这一块没<em>问题</em>rn@RequestMapping(value="insertPhoto",method=RequestMethod.POST)rn public String insertPhoto(HttpServletRequest request,ModelMap model) throws IOException, ServletExceptionrn request.setCharacterEncoding("utf-8");rn MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; rn // SimpleDateFormat dateformat = new SimpleDateFormat("yyyy/MM/dd/HH"); rn //构建图片保存的目录 rn // String logoPathDir = "/upload"+ dateformat.format(new Date()); rn //得到图片保存目录的真实路径 rn String logoRealPathDir = request.getSession().getServletContext().getRealPath("/upload"); rn // 根据真实路径创建目录 rn File logoSaveFile = new File(logoRealPathDir); rn if(!logoSaveFile.exists()) rn logoSaveFile.mkdirs(); rn //页面控件的文件流 rn MultipartFile multipartFile = multipartRequest.getFile("file"); rn // 获取文件的后缀 rn String suffix = multipartFile.getOriginalFilename().substring rn (multipartFile.getOriginalFilename().lastIndexOf(".")); rn //使用UUID生成文件名称 rn //String logImageName = UUID.randomUUID().toString()+ suffix;//构建文件名称 rn String logImageName = multipartFile.getOriginalFilename(); rn //**拼成完整的文件保存路径加文件**//* rn String fileName = logoRealPathDir + File.separator + logImageName; rn File file = new File(fileName); rn try rn multipartFile.transferTo(file); rn catch (IllegalStateException e) rn e.printStackTrace(); rn catch (IOException e) rn e.printStackTrace(); rn rn model.put("fileName", fileName); rn return "/CMS/success1.jsp"; rn rnrn这是下载的,我在网上找了一段代码套上去,但是实现不了功能,求助..rn@RequestMapping("/download/fileName") rn public ModelAndView download(@PathVariable("fileName") rn String fileName, HttpServletRequest request, HttpServletResponse response) rn throws Exception rn response.setContentType("text/html;charset=utf-8"); rn request.setCharacterEncoding("UTF-8"); rn java.io.BufferedInputStream bis = null; rn java.io.BufferedOutputStream bos = null; rn rn String ctxPath = request.getSession().getServletContext().getRealPath("/upload"); rn String downLoadPath = ctxPath + fileName; rn System.out.println("---:"+downLoadPath); rn try rn long fileLength = new File(downLoadPath).length(); rn response.setContentType("application/x-msdownload;"); rn response.setHeader("Content-disposition", "attachment; filename=" rn + new String(fileName.getBytes("utf-8"), "ISO8859-1")); rn response.setHeader("Content-Length", String.valueOf(fileLength)); rn bis = new BufferedInputStream(new FileInputStream(downLoadPath)); rn bos = new BufferedOutputStream(response.getOutputStream()); rn byte[] buff = new byte[2048]; rn int bytesRead; rn while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) rn bos.write(buff, 0, bytesRead); rn rn catch (Exception e) rn e.printStackTrace(); rn finally rn if (bis != null) rn bis.close(); rn if (bos != null) rn bos.close(); rn rn return null; rn rnrn页面rn rn $fileName rn
spring mvc国际化的问题
properties、xml、jsp都写好了,可以正常运行:rnindex.do?locale=zh_CN -- 显示中文标签rnindex.do?locale=en_US -- 显示英文标签rnrn但是有个<em>问题</em>:如果直接访问index.do,显示的是中文标签,为什么?是和浏览器有关,还是操作系统有关?rn具体是哪个<em>参数</em>有关?rnrn说明:项目的要求是,要有中文版、英文版、俄文版的,不同客户打开同一个网站(同一个地址,不包含“?locale=***”),会自动的显示中文或英文或俄文的标签。
Spring mvc的相关问题
一般情况下,简单的<em>spring</em> <em>mvc</em>除了web.xml应该包含三个主要的.xml文件,分别是数据库配置文件,以hibernate为例: http://www.w3.org/2001/X
spring mvc 的使用问题
最近用到<em>spring</em> <em>mvc</em>以前一直没有接触过,想问下<em>spring</em> <em>mvc</em> 有没有类似于servlet的services的方法呢rnrnprotected void service(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException }rnrn就是每次进入到<em>mvc</em>的方法前一定进入的方法,我需要封装一些数据。rn如果有,麻烦指教一二。rn谢谢啦
Spring MVC验证问题
我用<em>spring</em> 调用common的validator进行页面验证的时候,如果是String型的,则验证正常.如果是Integer型的就出错?rnFailed to convert property value of type [java.lang.String] to required type [java.lang.Integer] for property age; nested exception is java.lang.NumberFormatException: For input string: "" rnrn后来我在Controller中加了一段:rn protected void initBinder(HttpServletRequest request,ServletRequestDataBinder binder) throws Exception rn binder.registerCustomEditor(Integer.class,new CustomNumberEditor(Integer.class,null,true)); rn rnrn然后,刚才始进入页面时不出错了,即不输入数据的时候不出错,一旦输入了字符,则就出现如下错误:rnFailed to convert property value of type [java.lang.String] to required type [int] for property age; nested exception is java.lang.NumberFormatException: For input string: "ff"rnrnrnrn我在validation.xml中的配置如下:rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rnrn另外在user.java中rn age的类型为 integerrnrnrn请高手指点,谢谢!!!rn
Spring MVC视图问题
为什么会访问第二个方法,而不是第一个 @RequestMapping(value="/{viewpath}") public String getView(@PathVariable String viewpath){ System.out.println("viewpath"); return viewpath; } @RequestMapping(value="/index
spring mvc 自动装配的问题
遇到一个不唯一的异常:rn严重: Context initialization failedrnorg.<em>spring</em>framework.beans.factory.BeanCreationException: Error creating bean with name 'demoController': Autowiring of fields failed; nested exception is org.<em>spring</em>framework.beans.factory.BeanCreationException: Could not autowire field: private org.swunDms.swunDms.service.UserManager org.swunDms.swunDms.web.DemoController.userManager; nested exception is org.<em>spring</em>framework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.swunDms.swunDms.service.UserManager] is defined: Unsatisfied dependency of type [interface org.swunDms.swunDms.service.UserManager]: expected at least 1 matching beanrnrnCaused by: org.<em>spring</em>framework.beans.factory.BeanCreationException: Could not autowire field: private org.swunDms.swunDms.service.UserManager org.swunDms.swunDms.web.DemoController.userManager; nested exception is org.<em>spring</em>framework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.swunDms.swunDms.service.UserManager] is defined: Unsatisfied dependency of type [interface org.swunDms.swunDms.service.UserManager]: expected at least 1 matching beanrn at org.<em>spring</em>framework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:435)rn at org.<em>spring</em>framework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105)rn at org.<em>spring</em>framework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:240)rnrn我的控制器:rn@Controllerrnpublic class DemoController rn rn @Autowiredrn private UserManager userManager;rn rn @RequestMapping("/view.do")rn public String viewHandler(String url) rn return url;rn rn rn @RequestMapping("/viewPage.do")rn public String viewParameter(HttpServletRequest request,ModelMap model,String url)rn Enumeration parameterNames=request.getParameterNames();rn while(parameterNames.hasMoreElements())rn String parameterName=parameterNames.nextElement().toString();rn model.addAttribute(parameterName, request.getParameter(parameterName));rn rn return url;rn rn rn @RequestMapping("/demo.do")rn public String demo(ModelMap model)rn User user=userManager.get(1L);rn model.addAttribute("user",user);rn return "demo";rn rnrn我的UserManager的配置文件:rnrnrnrn rn rn rnrn我的DAO层的配置文件:rnrnrnrnrn rn rn org.swunDms.swunDms.domain.Userrn rn rn rnrn我的WEB.XML:rnrnrnrn rn rn contextConfigLocationrn classpath:applicationContext*.xmlrn rnrn rn rn encodingFilterrn org.<em>spring</em>framework.web.filter.CharacterEncodingFilterrn rn encodingrn UTF-8rn rn rnrn rn rn osivFilterrn org.<em>spring</em>framework.orm.hibernate3.support.OpenSessionInViewFilterrn rnrn rn encodingFilterrn /*rn rnrn rn osivFilterrn /*rn rnrn rn rn org.<em>spring</em>framework.web.context.ContextLoaderListenerrn rnrn rn rn swunDmsrn org.<em>spring</em>framework.web.servlet.DispatcherServletrn rn 2rn rnrn rn swunDmsrn *.dorn rn rn rn rn org.<em>spring</em>framework.web.util.IntrospectorCleanupListenerrn rnrn rn rn 20rn rnrn rn 404rn /common/404.jsprn rn rn 403rn /common/403.jsprn rnrnrn我的rnrn rn rn rnrn rn rnrn rn rnrn大哥们帮我看看<em>问题</em>。求救。我的UserManager没有定义几个。就一个。
关于Spring MVC的问题
正在学习Spring MVC,但是有点无从入手,请问谁有小实例程序可以给我发过来一个吗?一个最简单的登录程序就可以,现在不知道怎么配置,谢谢了 rn我信箱zxfsmart@163.com~~~~
Spring mvc问题
最近在学习<em>spring</em>2.5在工程中导入了<em>spring</em>2.5的<em>spring</em>.jar和<em>spring</em>-web<em>mvc</em>-2.5.jar,建立好项目后启动tomcat时报错rnorg.<em>spring</em>framework.beans.factory.BeanInitializationException: Could not find DispatcherServlet's default strategy class [org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapter] for interface [org.<em>spring</em>framework.web.servlet.HandlerAdapter]; nested exception is java.lang.ClassNotFoundException: org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapterrn原因是rnCaused by: java.lang.ClassNotFoundException: org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapterrn我查看了jar包,只在<em>spring</em>-web<em>mvc</em>-2.5.jar中有org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.DefaultAnnotationHandlerMapping这个类,请问我应该怎么办???谢谢
spring mvc新手问题
最近在看<em>spring</em> <em>mvc</em> rn写测试代码的时候遇到一个<em>问题</em> rn请大家帮忙解决下 rnrn<em>spring</em> controller代码rn[code=Java]rn@Controllerrn@RequestMapping(value="/test",method=RequestMethod.POST)rnpublic class TestControllerrn rn private TestManager testManager;rn rn public TestManager getTestManager() rn return testManager;rn rnrn public void setTestManager(TestManager testManager) rn this.testManager = testManager;rn rnrn @SuppressWarnings("unchecked")rn @RequestMapping("/doquery")rn public @ResponseBody String doTestQuery(@RequestParam("op_code") String op_code )rnrn Map paramMap = new HashMap();rn paramMap.put("op_code", op_code);rn Map resultMap = testManager.doTestQuery(paramMap);rn System.out.println(JSONObject.fromObject(resultMap).toString());rn return JSONObject.fromObject(resultMap).toString();rn rn rn rnrn[/code]rnrn执行到Map resultMap = testManager.doTestQuery(paramMap);的时候会报testManager空指针的<em>问题</em> rnrn<em>spring</em>。xml的配置是 rn[code=Java]rnrn rn rn rn rn rn[/code]rnrn我自己的理解是将testManager testController都交个<em>spring</em>容器管理了 rn而且自己写junit测试都是有的 但是每次都会出现空指针的<em>问题</em> rn请大家帮忙看看rnrn
Spring mvc 初级问题
刚学<em>spring</em> <em>mvc</em> ,想实现一个提交表单并保存到数据表的功能,rnJSP代码rn[code=html]rn rn权限ID: rn权限名称: rn rn rn[/code]rnrnController 代码rn[code=java]rn/**rn * rn */rnpackage org.clas.controller;rnrnrnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport org.clas.model.Tpermission;rnimport org.clas.service.TpermissionService;rnimport org.<em>spring</em>framework.stereotype.Controller;rnimport org.<em>spring</em>framework.web.bind.annotation.RequestMapping;rnrn/**rn * @author jiangenborn *rn * 转移转化平台权限控制管理rn */rnrn@Controllerrnpublic class AuthorityController rnrn /**rn * @author jiangenborn *rn * 添加权限信息rn */rn rn private TpermissionService tpermissionService; rn private Tpermission tpermission;rn rn @RequestMapping("/padd") rn public void PermissionAdd(HttpServletRequest request, HttpServletResponse response)rn String authid = request.getParameter("aid");rn String auname = request.getParameter("aname");rn System.out.println("aid==" + authid);rn System.out.println("aname==" + auname);rn tpermission.setAuthid(authid);rn tpermission.setAuthname(auname);rn tpermissionService.save(this.getTpermission());rn //return 1;rn rnrn public TpermissionService getTpermissionService() rn return tpermissionService;rn rnrn public void setTpermissionService(TpermissionService tpermissionService) rn this.tpermissionService = tpermissionService;rn rnrn public Tpermission getTpermission() rn return tpermission;rn rnrn public void setTpermission(Tpermission tpermission) rn this.tpermission = tpermission;rn rn rnrnrn[/code]rnrn可以执行到system.out.println,也就是说可以接收到<em>前端</em>传来的数据,再往后执行就错了,下面是错误信息:rn2013-3-18 17:44:52 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet dispatcher threw exceptionrnjava.lang.NullPointerExceptionrn at org.clas.controller.AuthorityController.PermissionAdd(AuthorityController.java:39)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.<em>spring</em>framework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)rn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)rn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)rn at org.clas.util.EncodingDispatcherServlet.doService(EncodingDispatcherServlet.java:25)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)rn。。。。。。rn不知道什么意思,为什么没有指针。Modle都定义了set get方法,求教!
Spring mvc 问题求助!
最近开始用<em>spring</em> <em>mvc</em> 做项目,jsp页面用jquery的ajax方法提交请求,dataType='json'如果表单没有一个的话,Spring Controller能返回json格式的数据,如果表单中有multipart元素 (file)则需要配置CommonsMultipartResolver进行解析,这是controller就不会返回给客户端json格式的数据,而是返回类型为text/html,这个可以从request.getHeader("Accept")返回值看出来,请问各位大侠怎么解决呀?急!!
spring mvc 访问问题
<em>spring</em> <em>mvc</em> java.lang.IllegalStateException: Errors/BindingResult argument declar 关于BindingResult Spring <em>mvc</em>2.5,3.0中,有关于 @ModelAttribute的注解,它可以帮你自动绑定表单的值,填充到被注解的属性当中。如 @ModelAttribute User ...
Spring MVC与表单提交的问题
1.model:rnrnpublic class UserType implements Serializable rn private static final long serialVersionUID = 1L;rnrn private int id;rn private String typeName;rn private String remark;rn private Date addDate;rn private Date editDate;rnrn2.rn rn rn 用户类型rn rn 类型名称: rn rn rn rn 备注: rn rn rn rn 添加时间: 2011-9-2 10:19:23 rn "/>rn rn rn 编辑时间: rn "/>rn rn rn rn rn rnrnrn3.controller 方法rnrn @RequestMapping(value = "create", method = RequestMethod.POST)rn public String create(@ModelAttribute UserType userType , Model model) //BindException exceptionrnrn rnrn4.<em>问题</em>rnrn一般情况下,添加时间和更新时间都不需要用户填写,但是如果去掉了这两个input的话,将会出现异常,提示字符串""向Date类型转换异常,毕竟用户都没有输入,因此提示这个情有可原,然而这两个时间是不需要用户输入的,我希望在方法体中手工设置:setAddDate(new Date())和setEditDate(new Date())rnrn请教这样的需求如何解决??rnrn
spring mvc问题
使用的是<em>spring</em> <em>mvc</em>,返回结果却不是预期的,具体如下rnrnrn[code=java]rn@RequestMapping("/index")rn public String index(WechatCallbackAPI callbackApi) rnrn return callbackApi.valid();rn rn[/code]rnrn访问该地址后,看到是这个方法<em>参数</em>的json不是return的结果,请问是什么原因,有什么办法可以解决。rn
Spring mvc 重定向问题
我做了个登陆,可是验证密码正确后不跳转rn@RequestMapping(value="/login",method=RequestMethod.POST)rn public ModelAndView login(rn String name,String pwd,String check,rn HttpSession session,rn HttpServletRequest req,rn HttpServletResponse resprn )rn String yzm = (String) session.getAttribute("rand");//普通验证码rn Loginfo lo=us.getUser(name,pwd);rn if(lo==null)rn req.setAttribute("checkmsg", "用户名或密码错误!!!");rn return new ModelAndView("redirect:/admin/main"); rn else if(lo!=null && !yzm.equals(check))rn req.setAttribute("checkmsg", "验证码错误!!!");rn return new ModelAndView("redirect:/admin/main"); rn elsern session.setAttribute("user", lo);rn return new ModelAndView("redirect:/admin/main"); rn rn rn rnrn或者public String login()rnrn return "/admin/main";rnrn都不能跳转啊。rnrn rn rn rn rn rn .jsprn rn rn请问还需要什么吗
spring MVC: 的问题!
jsp页面一加入就出现<em>问题</em>:rnjavax.servlet.ServletException: Neither Errors instance nor plain target object for bean name 'command' available as request attributern org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)rn ..........................rnrn部分代码如下:rnrnweb.xmlrn---------------------------------------------------------------------- rn rn Dispatcherrn org.<em>spring</em>framework.web.servlet.DispatcherServletrn rn contextConfigLocationrn /WEB-INF/Dispatcher-servlet.xmlrn rn rn rn Dispatcherrn *.dorn rn rnrn http://www.<em>spring</em>framework.org/tagsrn /WEB-INF/<em>spring</em>.tldrnrn rnrn--------------------------------------------------------------------------------rnrnrnDispatcher-servlet.xmlrn---------------------------------------------------------------------------------rn rn rn rn rn rn action.LoginInforn rn rn loginrn rn rn mainrn rn rnrn---------------------------------------------------------------------------------rnrnlogin.jsprn---------------------------------------------------------------------------------rnusername:rnrn" rnvalue=""rn >rn
Spring mvc注解的问题
当我的web.xmlrn[code=XML]rnrn appServletrn /rnrn[/code]rn里的url-pattern写成'/'.然后controller里的@RequestMapping("/"),这样写是可以正常访问到页面的rnrn如果我把xml里的'/'改成‘*.do’,@RequestMapping("/")改成@RequestMapping("test.do")就访问不到我的test.ftl了。这是什么情况rnrn我的web.xmlrn[code=XML]rnrnrn rn rn contextConfigLocationrn /WEB-INF/<em>spring</em>/root-context.xmlrn rn rn rn rn org.<em>spring</em>framework.web.context.ContextLoaderListenerrn rnrn rn rn appServletrn org.<em>spring</em>framework.web.servlet.DispatcherServletrn 1rn rn rn rn appServletrn /rn rn rn test.ftlrn rnrn[/code]rnrn我的appServlet-servlet.xmlrn[code=XML]rnrnrnrn rn rnrn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrnrn我的controller[code=Java]@RequestMapping("/")rn public String test(Locale locale, Model model) rn ListpeopleList=new ArrayList();rn People people=new People();rn people.setName("coco");rn people.setPosition("C52");rn people.setSex("male");rn rn People people2=new People();rn people2.setName("linn");rn people2.setPosition("C53");rn people2.setSex("male"); rn rn peopleList.add(people);rn peopleList.add(people2);rn model.addAttribute("people", people);rn model.addAttribute("peopleList", peopleList);rn return "test";rn rn [/code]rn
spring mvc 的一个问题
链接1:测试1--class rn链接2:测试2-class rnrn[code="java"]rn@Componentrn@RequestMapping("/")rnpublic class CatalogBaseController extends BaseMultiActionController rn rn rn @Autowiredrn ICatalogBaseService catalogBaseService;rn rnrn /**rn * @param catalogBaseService the catalogBaseService to setrn */rn public void setCatalogBaseService(ICatalogBaseService catalogBaseService) rn this.catalogBaseService = catalogBaseService;rn rn //class-1-0-0-index-1-1.html 须将urlrewrite.xml 中的相同规则注释,否则只会执行urlrewrite.xml的规则rn @RequestMapping(value="/class-ppcid-pcid-cid-index-type-p.html",method=RequestMethod.GET) rn public ModelAndView base(CatalogBaseModel cb,HttpServletRequest request,HttpServletResponse response)rn Map map=new HashMap();rn System.out.println(" cb.getPpcid() = "+cb.getPpcid());rn return toView("orderflow/cart/cart", map);rn rn //class-1-4-30-index-1-0-0-0-0-0-0-0-0-1.htmlrn @RequestMapping(value="/class-ppcid-pcid-cid-index-type-priceid-lower-high-bid-order-sortType-province-city-p.html",method=RequestMethod.GET) rn public ModelAndView more(CatalogBaseModel cb,HttpServletRequest request,HttpServletResponse response)rn Map map=new HashMap();rn System.out.println(" cb.getPpcid() = "+cb.getPpcid());rn return toView("orderflow/cart/cart", map);rn rn rn[/code]rn为何链接1能正常访问rn链接2就报错了,rn[code="java"]rnorg.<em>spring</em>framework.web.util.NestedServletException: Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:575)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at com.cwc.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:126)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rnrn at com.bbf.common.filter.InitFilter.doFilter(InitFilter.java:30)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.<em>spring</em>framework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.<em>spring</em>framework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rnrn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rnrn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)rnrn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn at org.<em>spring</em>framework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:110)rn at org.<em>spring</em>framework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:75)rn at org.<em>spring</em>framework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162)rn at org.<em>spring</em>framework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:123)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100)rnrn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)rn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)rn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)rnrn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)rn ... 33 morern[2012-12-10 17:43:40,235] [ERROR] SetCharacterEncodingFilter.doFilter throwable.toString() = org.<em>spring</em>framework.web.util.NestedServletException: Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn[2012-12-10 17:43:40] [ERROR] SetCharacterEncodingFilter.doFilter throwable.toString() = org.<em>spring</em>framework.web.util.NestedServletException: Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn[2012-12-10 17:43:40,235] [ERROR] SetCharacterEncodingFilter.doFilter begin rn[2012-12-10 17:43:40] [ERROR] SetCharacterEncodingFilter.doFilter begin rn[2012-12-10 17:43:40,235] [ERROR] SetCharacterEncodingFilter.doFilter:org.<em>spring</em>framework.web.util.NestedServletException: Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn[2012-12-10 17:43:40] [ERROR] SetCharacterEncodingFilter.doFilter:org.<em>spring</em>framework.web.util.NestedServletException: Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn[2012-12-10 17:43:40,236] [ERROR] Referer:http://www.800pharm.com/shop/monitor/moni.jsprn[2012-12-10 17:43:40] [ERROR] Referer:http://www.800pharm.com/shop/monitor/moni.jsprn[2012-12-10 17:43:40,236] [ERROR] Current URL:/shop/class-1-4-30-index-1-0-0-0-0-0-0-0-0-1.htmlrn[2012-12-10 17:43:40] [ERROR] Current URL:/shop/class-1-4-30-index-1-0-0-0-0-0-0-0-0-1.htmlrn[2012-12-10 17:43:40,236] [ERROR] Visitor:Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0rn[2012-12-10 17:43:40] [ERROR] Visitor:Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0rn[2012-12-10 17:43:40,236] [ERROR] Parameters:rn[2012-12-10 17:43:40] [ERROR] Parameters:rn[2012-12-10 17:43:40,236] [ERROR] IP:127.0.0.1rn[2012-12-10 17:43:40] [ERROR] IP:127.0.0.1rn[2012-12-10 17:43:40,236] [ERROR] SetCharacterEncodingFilter-----error-Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn[2012-12-10 17:43:40] [ERROR] SetCharacterEncodingFilter-----error-Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn[2012-12-10 17:43:40,237] [ERROR] SetCharacterEncodingFilter.doFilter end rn[2012-12-10 17:43:40] [ERROR] SetCharacterEncodingFilter.doFilter end rnorg.<em>spring</em>framework.web.util.NestedServletException: Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:575)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at com.cwc.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:126)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rnrn at com.bbf.common.filter.InitFilter.doFilter(InitFilter.java:30)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rnrn at org.<em>spring</em>framework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.<em>spring</em>framework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)rnrn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rnrn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn at org.<em>spring</em>framework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:110)rn at org.<em>spring</em>framework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:75)rn at org.<em>spring</em>framework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162)rn at org.<em>spring</em>framework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:123)rnrn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565)rn at org.<em>spring</em>framework.web.servlet.<em>mvc</em>.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)rnrn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)rn at org.<em>spring</em>framework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)rn at org.<em>spring</em>framework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)rn ... 33 morernjavax.servlet.ServletException: SetCharacterEncodingFilter.doFilter IOException:org.<em>spring</em>framework.web.util.NestedServletException: Request processing failed; nested exception is org.<em>spring</em>framework.validation.BindException: org.<em>spring</em>framework.validation.BeanPropertyBindingResult: 1 errorsrnField error in object 'catalogBaseModel' on field 'type': rejected value [1-0-0-0-0-0-0-0-0]; codes [typeMismatch.catalogBaseModel.type,typeMismatch.type,typeMismatch.int,typeMismatch]; arguments [org.<em>spring</em>framework.context.support.DefaultMessageSourceResolvable: codes [catalogBaseModel.type,type]; arguments []; default message [type]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'type'; nested exception is java.lang.NumberFormatException: For input string: "1-0-0-0-0-0-0-0-0"]rn at com.cwc.filter.SetCharacterEncodingFilter.processException(SetCharacterEncodingFilter.java:186)rn at com.cwc.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:131)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rnrn at com.bbf.common.filter.InitFilter.doFilter(InitFilter.java:30)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.<em>spring</em>framework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.<em>spring</em>framework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)rnrn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rnrn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rnrn at java.lang.Thread.run(Thread.java:722)rnrn[/code]rn有没有大神能帮忙解惑
spring mvc问题
<em>spring</em> MVC 里的自定义controllerrnrn新的一个方法里给一个ModelAndView里放一个对象rn这个方法然后返回一个Stringrnrn我的<em>问题</em>是是,那个返回的页面是html它是怎么解析一个java对象的?
spring mvc 简单问题
刚学这个,我按照书上的资料写了一个登陆的简单程序,可是在运行的时候说我没设置SUCCESSVIEW,当我设置了以后页面直接跳到我设置的successView页面了,没经过ACTION,请问谁能告诉我这个怎么回事啊~先谢谢了
djl 贸泰 ucw文件播放器下载
贸泰录像机文件专用播放器,djl文件播放器,ucm文件播放器。 相关下载链接:[url=//download.csdn.net/download/caijishi/2643984?utm_source=bbsseo]//download.csdn.net/download/caijishi/2643984?utm_source=bbsseo[/url]
聊天软件,用套接字编写,完整代码下载
一款由C++编写的简单聊天软件,主要应用到套接字,线程,在软件中,输入对方IP地址,即可与对方聊天。完整的代码,已经通过调试运行。 相关下载链接:[url=//download.csdn.net/download/huriyuan00/2920419?utm_source=bbsseo]//download.csdn.net/download/huriyuan00/2920419?utm_source=bbsseo[/url]
hadoop安装笔记下载
hadoop安装笔记 相关下载链接:[url=//download.csdn.net/download/aaa1117a8w5s6d/7668619?utm_source=bbsseo]//download.csdn.net/download/aaa1117a8w5s6d/7668619?utm_source=bbsseo[/url]
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数
我们是很有底线的