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添加它的映射方法即可。