Java InternalResourceViewResolver和Winstone存在问题
我的spring项目有问题 这是我的web.xmlJava InternalResourceViewResolver和Winstone存在问题,java,spring,jsp,jakarta-ee,Java,Spring,Jsp,Jakarta Ee,我的spring项目有问题 这是我的web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>greenmine</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>greenmine</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/greenmine-servlet.xml
</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
我使用的是Winstone Servlet引擎v0.9.10。
当我转到时,它会显示以下错误:
14.04.2011 21:48:13 org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNUNG: No mapping found for HTTP request with URI [/WEB-INF/jsp/login/login.jsp] in DispatcherServlet with name 'greenmine'
但是login.jsp在WEB-INF/jsp/login/login.jsp中
希望有人能帮助我。我已经搜索了两个星期。您只需要在配置中添加一个处理程序 查看您的代码,您可以添加以下行来修复该问题
<bean class=" org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
我们说注释将由DefaultAnnotationHandler
类处理。当您基于注释定义控制器时,该类知道该做什么
AnnotationMethodHandlerAdapter
理解方法上的注释(如@RequestMapping
)。以下标签解决了我的问题:
<mvc:default-servlet-handler/>
我在greenmine-servlet.xml中添加了这两行,但没有任何变化。
<bean class=" org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
<mvc:default-servlet-handler/>