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

sujiangchichu 2014-05-02 09:45:23
org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/school5/newsInput.html] in DispatcherServlet with name 'b505'

**************************************************************************************************************************************
项目名:school5
**************************************************************************************************************************************
web.xml配置

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>school5</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>school5</param-value>
</context-param>
<servlet>
<servlet-name>b505</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/b505-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>b505</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<filter>
<filter-name>openSession</filter-name>
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSession</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
</web-app>
**************************************************************************************************************************************
b505-servlet.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:p="http://www.springframework.org/schema/p"
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"

xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<!-- 开启controller注解支持 -->
<context:component-scan base-package="com.b505.web">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>

<mvc:default-servlet-handler/>

<mvc:annotation-driven >
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter" >
<property name="supportedMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
<value>text/html;charset=UTF-8</value>
</list>

</property>

</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- 上传图片和文件 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="104857600" />
<property name="maxInMemorySize" value="4096" />
<property name="defaultEncoding" value="UTF-8"></property>
</bean>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:viewClass="org.springframework.web.servlet.view.JstlView"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />


<!-- 声明DispatcherServlet不要拦截下面声明的目录 -->
<mvc:resources location="/js/" mapping="/js/**" />
<mvc:resources location="/newsimg/" mapping="/newsimg/**"/>
<mvc:resources location="/images/" mapping="/images/**"/>
<mvc:resources location="/css/" mapping="/css/**"/>
<mvc:resources location="js/themes/default/" mapping="js/themes/default/**"/>
</beans>
**************************************************************************************************************************************
尝试了:重新装MyEclipse,重新装Tomcat。在其他网站上查了很多,照着做都没有成功。
注:项目在另一台电脑上可以正常运行,在我的电脑上就不行了。又将项目移到服务器机子上也不行,现在我们的项目只能在一台机子上正常运行,好奇怪。
求教。
...全文
15789 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
botak_233 2016-12-21
  • 打赏
  • 举报
回复
引用 13 楼 csdn_ljh 的回复:
我是在请求css和js引用文件的时候报这错了,解决办法是让spring的servlet只过滤 .do后缀的请求
帮了大忙了 拜谢
chwb12345678 2016-11-14
  • 打赏
  • 举报
回复
哎呦,点错了,13楼对不起,投我个板砖得了
chwb12345678 2016-11-14
  • 打赏
  • 举报
回复
检查路径无误的话,加个绝对路径就行
轻度愉悦 2016-06-03
  • 打赏
  • 举报
回复
我是在请求css和js引用文件的时候报这错了,解决办法是让spring的servlet只过滤 .do后缀的请求

wjwei1213 2015-03-08
  • 打赏
  • 举报
回复
这个问题解决了吗?我也遇到了这个问题
chon_ye 2014-07-28
  • 打赏
  • 举报
回复
我也有这个问题
sujiangchichu 2014-05-07
  • 打赏
  • 举报
回复
引用 6 楼 rui888 的回复:
路径对不,后台进没?如果找不到的话应该所有类似的url 都会有问题
这个项目在其他电脑上完全可以跑起来的,就是在我电脑上有问题了,至今不明白问题出在哪。
sujiangchichu 2014-05-07
  • 打赏
  • 举报
回复
引用 5 楼 xuefeng0707 的回复:
是不是b505-servlet.xml里要配置一下不拦截*.html
这个项目在其他电脑上完全可以跑起来的,就是在我电脑上有问题了,至今不明白问题出在哪。
sujiangchichu 2014-05-07
  • 打赏
  • 举报
回复
引用 4 楼 wyx100 的回复:
报错信息贴出来
贴出来了啊 org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/school5/newsInput.html] in DispatcherServlet with name 'b505'
tony4geek 2014-05-06
  • 打赏
  • 举报
回复
路径对不,后台进没?如果找不到的话应该所有类似的url 都会有问题
xuefeng0707 2014-05-06
  • 打赏
  • 举报
回复
是不是b505-servlet.xml里要配置一下不拦截*.html
wyx100 2014-05-06
  • 打赏
  • 举报
回复
报错信息贴出来
sujiangchichu 2014-05-06
  • 打赏
  • 举报
回复
顶一下吧,为了苦逼的程序员,这问题太难解。
sujiangchichu 2014-05-05
  • 打赏
  • 举报
回复
引用 1 楼 defonds 的回复:
是下面的声明没有起作用?
就是这个项目,原封不动的移到其它的电脑上就可以跑起来,没有这样的问题,单单是在我的电脑上有问题。 求解,我已经重装了系统,重装了MyEclipse,重装了Tomcat,可是还是报这样的错误。
Defonds 2014-05-03
  • 打赏
  • 举报
回复
是下面的声明没有起作用?
内容概要:本文围绕“面向高精度电流控制的PMSM多参数PSO辨识模型研究”,系统阐述了基于Simulink的永磁同步电机(PMSM)多参数辨识方法,重点采用粒子群优化算法(PSO)实现对电机关键内部参数的高精度辨识。研究构建了完整的PMSM控制系统仿真模型,结合智能优化算法,解决了传统参数辨识中精度低、收敛慢的问题,有效提升了电流环控制的动态性能与稳态精度。该方法特别适用于对控制精度和响应速度要求较高的工业应用场景,如高性能伺服系统、电动汽车驱动系统等,具有较强的工程实用价值和科研参考意义。文中提供了完整的Simulink仿真模型与配套代码,确保了研究内容的可复现性和实践操作性。; 适合人群:具备电机控制、自动化或电气工程等相关专业背景,熟悉MATLAB/Simulink仿真环境,从事电机驱动系统研发、控制算法设计或相关领域科研工作的工程师及研究生,尤其适合工作1-5年、希望深入理解先进参数辨识技术的研发人员。; 使用场景及目标:①开展高精度PMSM控制系统的设计与参数辨识研究;②学习并掌握PSO等智能优化算法在电机系统参数辨识中的具体实现与调优技巧;③完成学术论文复现、科研项目验证、毕业设计或工程原型开发,提升对现代电机控制核心技术的理解与应用能力。; 阅读建议:建议读者结合提供的Simulink模型与源代码进行动手实践,按照文档逻辑逐步搭建与调试仿真系统,重点关注PSO算法与电机模型的交互机制、目标函数设计及参数收敛过程,通过对比不同工况下的辨识结果,深入理解算法性能与控制精度之间的内在联系。

81,111

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧