spring-mvc 抓取视图报错:No mapping found for HTTP

五月 09, 2017 3:19:15 下午 org.springframework.web.servlet.PageNotFound noHandlerFound
警告: No mapping found for HTTP request with URI [/MyWeb2/view/index.jsp] in DispatcherServlet with name 'spring'

修改配置文件,将

<servlet>
		<servlet-name>spring</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>spring</servlet-name>
		<url-pattern>/*</url-pattern>
	</servlet-mapping>

改为

<servlet>
		<servlet-name>spring</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>spring</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>

转载至:http://hw1287789687.iteye.com/blog/1947580

展开阅读全文

求助:Spring MVC环境报错 No mapping found for HTTP request with URI

08-10

之前一直用的struts2,第一次自己搭建一个简单的spring mvc架构,一直卡在这个报错rnorg.springframework.web.servlet.PageNotFound noHandlerFoundrn警告: No mapping found for HTTP request with URI [/yplatform/version.htm] in DispatcherServlet rnwith name 'yplatform'。rn其实是一个很简单的Demo,已经找了一天问题了,只能发帖求助。我贴下我的配置,rn先是项目结构rn[img=https://img-bbs.csdn.net/upload/201508/10/1439187340_600288.png][/img]rnrn然后是web.xml配置rn[img=https://img-bbs.csdn.net/upload/201508/10/1439187435_691567.png][/img]rnrn再是spring-mvc.xmlrn[img=https://img-bbs.csdn.net/upload/201508/10/1439187610_308829.png][/img]rnrn最后看下Controller里的配置rn[img=https://img-bbs.csdn.net/upload/201508/10/1439187838_78101.png][/img]rnrnspring-config里没有什么配置,都放到spring-mvc.xml里了,之前也放过spring-config,然并卵。rn百度过很多帖子,有3/4都说是吧Url-pattern从/*改成/即可,或者*.do 类似这样的,这些原理我都懂rn但是现在并没有涉及到其他东西,只是一个简单的请求跳转,打了断点并没有进方法,rn怀疑是不是这个controller没有被扫描到,控制台一直是这个报错信息rn[img=https://img-bbs.csdn.net/upload/201508/10/1439187939_738032.png][/img]rnrn望各位有经验的前辈不吝赐教,有什么其他信息需要提供的请补充。rn 论坛

No mapping found for HTTP request with URI in DispatcherServlet

03-21

在做一个springMVC项目的时候,遇到了这种问题。在网上看了好多总是无法解决。rnweb.xml代码如下:rn[code=html]rnrn mvcrn rn index.htmlrn index.htmrn index.jsprn default.htmlrn default.htmrn default.jsprn rn rn springMVCrn org.springframework.web.servlet.DispatcherServletrn rn contextConfigLocationrn classpath*:config/springAnnotation-servlet.xmlrn rn 1rn rn rn rn springMVCrn /rn rn [/code]rnrnspringAnnotation-servlet.xml代码如下:rn[code=html]rnrn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn [/code]rnrnUserController.java代码如下:rn[code=java]package com.controller.annotation;rnrnimport org.springframework.stereotype.Controller;rnimport org.springframework.web.bind.annotation.RequestMapping;rnimport org.springframework.web.bind.annotation.RequestMethod;rnimport org.springframework.web.servlet.ModelAndView;rnrn@Controllerrnpublic class UserController rn rn @RequestMapping(value="/user/addUser",method=RequestMethod.POST)rn public ModelAndView addUser()rn rn String result ="this is addUser------";rn return new ModelAndView("/annotation","result",result);rn rn rn @RequestMapping(value="/user/delUser",method=RequestMethod.GET)rn public ModelAndView delUser()rn String result ="this is delUser------";rn return new ModelAndView("/annotation","result",result);rn rn @RequestMapping(value="/user/toUser",method=RequestMethod.GET)rn public ModelAndView toUser()rn return new ModelAndView("/annotation");rn rnrn[/code]rnrnannotation.jsp代码如下:rn[code=html]<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rn<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>rnrnrnrn rn rn Insert title herernrnrnrn rn springMVC注解1rn rn rn $result rn rn rn rnrn[/code]rn通过URL访问时总是提示警告: No mapping found for HTTP request with URI [/mvc4/user/addUser] in DispatcherServlet with name 'springMVC' 论坛

请教各位[org.springframework.web.servlet.PageNotFound]No mapping found for HTTP

03-25

[org.springframework.web.servlet.PageNotFound]No mapping found for HTTP request with URI [/hlmkyh/pages/login/loginController.do] in DispatcherServlet with name 'springMvc'。rnrnrn*******************************************************************************************************************************rnrn*******************************************************************************************************************************rnweb.xml配置rnrnrnrn rn rn rn webAppRootKeyrn lxrn rn rn log4jConfigLocationrn classpath:log4j.propertiesrn rn rn rn org.springframework.web.util.Log4jConfigListenerrn rn rn contextConfigLocationrn classpath:spring-*.xmlrn rn rn rn 字符集过滤器rn encodingFilterrn org.springframework.web.filter.CharacterEncodingFilterrn rn 字符集编码rn encodingrn UTF-8rn rn rn rn encodingFilterrn /*rn rn rn druidWebStatFilterrn com.alibaba.druid.support.http.WebStatFilterrn rn exclusionsrn /css/*,/js/*,/images/*,/context/*,/plug-in/*,*.js,*.css,*/druid*,/attached/*,*.jsprn rn rn principalSessionNamern sessionInforn rn rn profileEnablern truern rn rn rn druidWebStatFilterrn /*rn rn rn spring监听器rn org.springframework.web.context.ContextLoaderListenerrn rn rn Introspector缓存清除监听器rn org.springframework.web.util.IntrospectorCleanupListenerrn rn rn request监听器rn org.springframework.web.context.request.RequestContextListenerrn rnrn rn spring mvc servletrn springMvcrn org.springframework.web.servlet.DispatcherServletrn rn spring mvc 配置文件rn contextConfigLocationrn classpath:spring-mvc.xmlrn rn 1rn rn rn springMvcrn *.dorn rn rn druidStatViewrn com.alibaba.druid.support.http.StatViewServletrn rn rn druidStatViewrn /pages/system/druid/*rn rn rn rn restSpringMvcrn org.springframework.web.servlet.DispatcherServletrn rn spring mvc 配置文件rn contextConfigLocationrn classpath:spring-mvc.xmlrn rn rn rn restSpringMvcrn /rest/*rn rn rn rn XFireServletrn org.codehaus.xfire.spring.XFireSpringServletrn 2rn rn rn XFireServletrn /services/*rn rnrn rn rn 30rn rn rn rn /pages/login/login.jsprn rn rnrn***********************************************************************************************************************rnspring-mvc.xml的配置rnrnrn rn rn rn rn rnrn rn rnrn rn rn rn rn text/html;charset=UTF-8rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn 1048576000000rn rn rn 4096rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn loginController.do?loginrn loginController.do?checkuserrn dicAzbglController.do?downloadrn rn rn rn rn rnrnrn***************************************************************************************************************************rn所有的后台链接都报错,不知道是哪里出的问题 论坛

【请教】org.springframework.web.servlet.PageNotFound - No mapping found for HTTP req

05-02

org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/school5/newsInput.html] in DispatcherServlet with name 'b505'rnrn**************************************************************************************************************************************rn项目名:school5rn**************************************************************************************************************************************rnweb.xml配置[b][/b]rnrnrnrn school5rn rn index.htmlrn index.htmrn index.jsprn default.htmlrn default.htmrn default.jsprn rn rn contextConfigLocationrn rn classpath:applicationContext.xmlrn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn webAppRootKeyrn school5rn rn rn b505rn org.springframework.web.servlet.DispatcherServletrn rncontextConfigLocationrn/WEB-INF/b505-servlet.xmlrnrn 1rn rn rn b505rn *.htmlrn rn rn openSessionrn org.springframework.orm.hibernate4.support.OpenSessionInViewFilterrn rn rn openSessionrn *.htmlrn rn rn Set Character Encodingrn org.springframework.web.filter.CharacterEncodingFilterrn rn encodingrn UTF-8rn rn rn forceEncodingrn truern rn rn rn Set Character Encodingrn /*rn rn rn log4jConfigLocationrn /WEB-INF/classes/log4j.propertiesrn rn rn log4jRefreshIntervalrn 60000rn rn rn rn org.springframework.web.util.Log4jConfigListener rn rn rnrn**************************************************************************************************************************************rnb505-servlet.xml配置rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn application/json;charset=UTF-8 rn text/html;charset=UTF-8rn rnrn rnrn rn rnrnrnrnrn rn rnrn rnrnrn rn rn rn rn rn rnrn**************************************************************************************************************************************rn[b]尝试了:重新装MyEclipse,重新装Tomcat。在其他网站上查了很多,照着做都没有成功。rn注:项目在另一台电脑上可以正常运行,在我的电脑上就不行了。又将项目移到服务器机子上也不行,现在我们的项目只能在一台机子上正常运行,好奇怪。rn求教。[/b] 论坛

No mapping found for HTTP request with URI [/swsrv/jsp/fileUpload.s] in Dispatch

02-07

No mapping found for HTTP request with URI [/swsrv/jsp/fileUpload.s] in DispatcherServlet with name 'SpringMVC'这个问题困然了我很长时间了,之前用测试挺好的,用上了EasyUI这个插件以后就一直报这个错误,不是很清楚这个URI中的/swsrv/jsp是怎么来的。rn[code=java]@Controllerrnpublic class Swsrv_PackageController rnrn @Autowiredrn private Swsrv_PackageService swsrv_PackageService;rn rn /**rn * 二进制文件上传rn * @param request rn * @param file 需要上传的文件rn * @return 文件上传结果页面rn */rn @RequestMapping("fileUpload.s")rn public ModelAndView fileUpload(@RequestParam("file") MultipartFile file, String pid, int pLevel, String version, String unit, Date date) rn int id = Integer.valueOf(pid);rn Swsrv_Package swsrv_Package = new Swsrv_Package();rn String fileName = file.getOriginalFilename();rn SoftUpgrade su = new SoftUpgrade();rn byte[] inputData = null;rn if (file != null) [/code]rn[code=java]rn rn rn SpringMVCrn org.springframework.web.servlet.DispatcherServletrn rn contextConfigLocationrn classpath:spring-mvc.xmlrn rn 1rn rn rn SpringMVCrn rn *.srn rn[/code]rn[code=javascript]function ImportShipmentStatusList() rn if ($("#fuImportMultipleShipmentStatus").val() == "" ) rn alert("Please select a file to upload"); rn return;rn rn $.ajax(rn url : 'fileUpload.s',rn secureuri : false,rn fileElementId : 'fuImportMultipleShipmentStatus',rn dataType : 'json',rn beforeSend : function() rn // 禁用按钮防止重复提交rn $("#addsubmit").attr(rn disabled : "disabled"rn );rn $("#addsubmit").val("上传中...");rn ,rn success : function(data, status) rn alert(data.message);rn $('#fuImportMultipleShipmentStatus').val('');rn rn );rn [/code]rnrn哪位大神能帮忙看一下啊!!![img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/8.gif][/img] 论坛

WAR包部署到WebSphere报错Servlet name for the servlet mapping could not be found

08-28

Eclipse+Tomcat7.0(jre.8)的WAR包部署到WebSphere8.5的时候报错rnrn[img=https://img-bbs.csdn.net/upload/201508/28/1440729214_53074.png][/img]rnrn[color=#FF0000]MessagesrnErrorWebQuery_war failed to start. Check the logs for server server1 on node Node01 for details.rnErrorAn error occurred while starting WebQuery_war. Check the logs for server server1 on node Node01 for more information.[/color]rnrn查看log打印信息rn[8/27/15 16:41:28:602 CST] 0000073b CompositionUn E WSVR0194E: Composition unit WebSphere:cuname=WebQuery1 in BLA WebSphere:blaname=WebQuery1 failed to start.rn[8/27/15 16:41:28:603 CST] 0000073b MBeanHelper E Could not invoke an operation on object: WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=Node01,version=8.5.5.3,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=Cell01,spec=1.0 because of an mbean exception: com.ibm.ws.exception.[color=#FF0000]RuntimeWarning: SRVE0303E: Servlet name for the servlet mapping /Login_do could not be found.[/color]rnrn最后那个Servlet name for the servlet mapping /Login_do could not be found.是什么原因啊?rnWebSphere要求的格式和tomcat不一样吗?rn但是在Tomcat的环境下完全可以跑起来,servlet用的是2.5rnrn这是web.xmlrnrnrn WebQueryrn rn index.htmlrn rn rn This is the description of my J2EE componentrn This is the display name of my J2EE componentrn Login_dorn servlet.Login_dorn rn rn This is the description of my J2EE componentrn This is the display name of my J2EE componentrn GetWellInfo_dorn servlet.GetWellInfo_dorn rn rn This is the description of my J2EE componentrn This is the display name of my J2EE componentrn GetWellOperDate_dorn servlet.GetWellOperDate_dorn rn rn This is the description of my J2EE componentrn This is the display name of my J2EE componentrn GetDiagID_dorn servlet.GetDiagID_dorn rn rn This is the description of my J2EE componentrn This is the display name of my J2EE componentrn SetBaseDiag_dorn servlet.SetBaseDiag_dorn rn rn This is the description of my J2EE componentrn This is the display name of my J2EE componentrn UpdateWellOperDate_dorn servlet.UpdateWellOperDate_dorn rn rn rn Login_dorn /Login_dorn rn rn GetWellInfo_dorn /GetWellInfo_dorn rn rn GetWellOperDate_dorn /GetWellOperDate_dorn rn rn GetDiagID_dorn /GetDiagID_dorn rn rn SetBaseDiag_dorn /SetBaseDiag_dorn rn rn UpdateWellOperDate_dorn /UpdateWellOperDate_dorn rnrnrn求教给位大神 论坛

没有更多推荐了,返回首页