The origin server did not find a current representation for the target resource

exclipse建立的WEB的springmvc项目,报错,网上查了半天,现在连console都不显示错误,实在找不出来问题原因了,各位大神帮忙看看!!!

有网友说右击server,先移除项目,再双击,才可以更改,可是试了后还是置灰,不可改?

----------------------------------------------------------------------------------后记--------------------------------------------------------------------

删除windows里的prefrences里的tomcat,

再重新配置tomcat,在server里添加tomcat过程中不将项目add到右面,之后双击即可修改。

---------------------------------------------------------------------------------------------------------------------------------------------------------------

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" 
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>HomeWorks</display-name>
  <welcome-file-list>
    <welcome-file>/Login</welcome-file>
   
  </welcome-file-list>
  
  <servlet>
    <servlet-name>springmvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    
    <multipart-config>
	<max-file-size>20848820</max-file-size>
	<max-request-size>418018841</max-request-size>
	<file-size-threshold>1048576</file-size-threshold>
	</multipart-config>
  </servlet>
  <servlet-mapping>
    <servlet-name>springmvc</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  
</web-app>

springmvc-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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context.xsd">


<context:component-scan base-package="cn.itcast.work.controller"/>
<context:component-scan base-package="cn.itcast.work.service"/>

<mvc:default-servlet-handler/>
<mvc:annotation-driven/>
<mvc:resources mapping="/css/**" location="/css/"/>
<mvc:resources mapping="/*.html" location="/"/>
<mvc:resources mapping="/images/**" location="/images/" />
<mvc:resources mapping="/js/**" location="/js/" />
<mvc:resources mapping="/upload/**" location="/upload/" />
<mvc:resources mapping="/img/**" location="/img/" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
</bean>

</beans>

我看过了版本是3.0,对的

报的错误是

console里也不报错误,请帮帮忙解答!

问题:The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

--------------------------------------------------------------------------------------后记--------------------------------------------------------------------------

网上排除了很多情况,最终找到答案,mvc框架中,Login.jsp需要有请求映射,所以在controller添加它的映射方法即可。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值