可恶的 No mapping found for HTTP request with URI 弄了两天了 求大神帮助下

问题描述

刚学习用srpingMVC遇见这个问题两天了求大神帮助下啊QQ463042360web.xmlapplicationContext-mvc.xml<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:p="http://www.springframework.org/schema/p"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.2.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.2.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"><mvc:annotation-driven></mvc:annotation-driven><context:component-scanbase-package="com.iuxia.controller"></context:component-scan><mvc:default-servlet-handler/><mvc:annotation-drivencontent-negotiation-manager="contentNegotiationManager"><!--配置SpringMVC返回中文乱码--><mvc:message-convertersregister-defaults="true"><!--将StringHttpMessageCOnverter的默认编码设为UTF-8--><beanclass="org.springframework.http.converter.StringHttpMessageConverter"><constructor-argvalue="UTF-8"/></bean></mvc:message-converters><!--扩展传多个对象如user.nameuser1.name--><mvc:argument-resolvers><beanclass="com.iuxia.framework.annotation.FormModelMethodArgumentResolver"/><beanclass="com.iuxia.framework.annotation.RequestJsonParamMethodArgumentResolver"/></mvc:argument-resolvers></mvc:annotation-driven><!--视图解释类--><beanid="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver"><propertyname="prefix"value="/WEB-INF/views/"/><propertyname="suffix"value=".jsp"/><!--可为空,方便实现自已的依据扩展名来选择视图解释类的逻辑--><propertyname="viewClass"value="org.springframework.web.servlet.view.JstlView"/></bean><!--REST中根据URL后缀自动判定Content-Type及相应的View--><beanid="contentNegotiationManager"class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"><propertyname="mediaTypes"><value>json=application/jsonxml=application/xml</value></property></bean><!--对静态资源文件的访问方案一--><mvc:default-servlet-handler/><!--避免IE在ajax请求时,返回json出现下载--><beanid="jacksonMessageConverter"class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"><propertyname="supportedMediaTypes"><list><value>text/html;charset=UTF-8</value></list></property></bean><!--这里申明的id必须为multipartResolver--><beanid="multipartResolver"class="org.springframework.web.multipart.commons.CommonsMultipartResolver"p:defaultEncoding="utf-8"/></beans>packagecom.iuxia.controller.axuser;importjava.util.HashMap;importjava.util.List;importjava.util.Map;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.stereotype.Controller;importorg.springframework.web.bind.annotation.RequestMapping;importorg.springframework.web.servlet.ModelAndView;importcom.iuxia.base.model.PageConfig;importcom.iuxia.base.util.StringUtil;importcom.iuxia.controller.base.BaseController;importcom.iuxia.entity.Axuser;importcom.iuxia.framework.annotation.FormModel;importcom.iuxia.services.axuser.AxusersService;@Controller@RequestMapping("/axuser")publicclassAxusersControllerextendsBaseController{@AutowiredprivateAxusersServiceaxusersService;@RequestMapping(value="/index")publicModelAndViewindex(HttpServletRequestrequest,HttpServletResponseresponse,@FormModel("axuser")Axuseraxuser){ModelAndViewmav=newModelAndView();mav.setViewName("index");returnmav;}@RequestMapping(value="/userList")publicModelAndViewuserList(HttpServletRequestrequest,HttpServletResponseresponse,@FormModel("axuser")Axuseraxuser){ModelAndViewmav=newModelAndView();//分页开始//pageNum当前页码//numPerPage每页大小intpageNum=StringUtil.parseInt(request.getParameter("pageNum"));intnumPerPage=StringUtil.parseInt(request.getParameter("numPerPage"));if(pageNum==0){pageNum=1;}if(numPerPage==0){numPerPage=25;}Map<String,Object>maps=newHashMap<String,Object>();maps.put("pagestart",(pageNum-1)*numPerPage);maps.put("pagesize",numPerPage);if(!StringUtil.empty(axuser.getUsername())){maps.put("username",axuser.getUsername());}inttotalCount=axusersService.getCount(maps);List<Object>list=axusersService.getList(maps);PageConfigpageConfig=newPageConfig(numPerPage,totalCount,pageNum,10,list);mav.addObject("pageConfig",pageConfig);mav.setViewName("background/axuser/usersList");returnmav;}}访问方法http://localhost:8080/IUXiaManager/axuser/index

解决方案

解决方案二:
试试:classpath*:spring/applicationContext-mvc.xml
解决方案三:
楼主解决了没有?

时间: 2024-09-20 18:43:08

可恶的 No mapping found for HTTP request with URI 弄了两天了 求大神帮助下的相关文章

springmvc-No mapping found for HTTP request with URI?

问题描述 No mapping found for HTTP request with URI? 解决方案 No mapping found for HTTP request with URI 如: ?<!-- dispatcherServlet 配置 --> ? <servlet> ? ? ? ? <servlet-name>dispatcher</servlet-name> &n......答案就在这里:Spring MVC No mapping

springmvc No mapping found for HTTP request with URI in Dispatc

项目是使用spring MVC (1)在浏览器中访问,后台总报错: Java代码   No mapping found for HTTP request with URI [/exam3/welcome] in DispatcherServlet with name 'spring2'    查了好半天,才发现是controller 没有扫描到. 我是使用的注解. spring mvc配置文件如下: Xml代码   <?xml version="1.0" encoding=&qu

no mapping found for http request with uri

问题描述 no mapping found for http request with uri 解决方案 http://bbs.csdn.net/topics/390401966 解决方案二: 控制器定义有错误,代码可以上来看看

spring-No mapping found for HTTP request with URI

问题描述 No mapping found for HTTP request with URI 这个问题 到现在还没解决掉,下面是问题连接http://bbs.csdn.net/topics/391042975 解决方案 报的错是没有找到URL路径 希望对你有用,http://zhidao.baidu.com/link?url=wKN1ljODIquUjabg2BLVGkzbS95GsRJNbIY-ilDuPF-6jU8Eec0fYJhtduLkGRNqZiex9KrPPT3LaoV-OeUUh

javaweb-通过request获取表单数据,但封装不到对象中,求大神解答!

问题描述 通过request获取表单数据,但封装不到对象中,求大神解答! # User类有username和password两个属性,封装的时候只能封装进去password,输出map的值的时候,里面是有的-- 以下是封装语句: User form = CommonUtils.toBean(request.getParameterMap(),User.class); 以下是CommonUtils类的toBean()方法:(不允许使用尖括号,泛型就用圆括号代替了-) public static (

No mapping found for HTTP request with URI [/HelloWeb/] in DispatcherServlet with name &amp;#39;HelloWeb&amp;#39; Spring MVC

I'm learning the Spring Framework, and I'm doing the HelloWeb tutorial on tutorialspoint, and I can't get it working. I'm using Spring MVC 4.0, and I'm deploying my app from Netbeans 8.0 to a Glassfish Server. http://www.tutorialspoint.com/spring/spr

求大神指导,Request.QueryString接收过来的字符串,中间有空格,空格后面会接收过来吗

问题描述 stringsjid="dqsg_R2Ea3yIROl_201508091501521406";我要接收这样的一个字符串,空格后面的内容(_201508091501521406)可以接收过来吗?用Request.QueryString接收的 解决方案 解决方案二:stringsjid="dqsg_R2Ea3yIROl_201508091501521406";Page.Server.UrlEncode(sjid);编码后放入url,肯定就不会有问题了解决方案

Ext.Ajax.request和formPanel.getForm().submit两种提交方法的区别

Ext.Ajax.request和formPanel.getForm().submit()两种提交方法的异同: 1. 相同点: a) 都是使用异步提交的方式: b) 默认都是使用POST方式来提交数据: 2. 不同点: a) Request方法不可以使用waitMsg属性来设置在等待响应过程中显示的信息,而submit方法提交时这个设置是可用的(可以看到效果,而前面说的不可用是指设置了看不到效果): b) Request方法必须将要提交的参数手动组织好然后作为名为params的参数的值才能提交到

callback(data)-javascript代码,从request取到callback值之后,有段代码没看懂,请大神指导。

问题描述 javascript代码,从request取到callback值之后,有段代码没看懂,请大神指导. if('${callback}' != ''){ var callback = eval('window.opener.${callback}'); callback(data); } 非常疑惑,为什么可以执行callback(data);这段代码没看懂啊. 解决方案 callback 是一个方法吧,你找找看