本文介绍了找不到带有URI [/WEB-INF/pages/apiForm.jsp]的HTTP请求的映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的处理程序转发到internalresourceview'apiForm',但随后出现错误404 RequestURI =/WEB-INF/pages/apiForm.jsp.我确定apiForm.jsp位于/WEB-INF/pages/

My handler forwards to internalresourceview 'apiForm' but then i get error 404 RequestURI=/WEB-INF/pages/apiForm.jsp. I'm sure apiForm.jsp located in /WEB-INF/pages/

这就是我的dispatcher.xml的样子.

this is how my dispatcher.xml look like..

<bean id="viewResolver"
    class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    <property name="prefix" value="/WEB-INF/pages/"/>
    <property name="suffix" value=".jsp"/>
</bean>

推荐答案

类似DispatcherServlet尝试处理对apiForm.jsp的请求,这向我建议您的web.xml Servlet映射将对该空间的请求定向到DispatcherServlet.

Looks like DispatcherServlet is trying to process the request for apiForm.jsp, which suggests to me that your web.xml servlet-mapping is directing requests for that space to DispatcherServlet.

您可能会遇到这样的事情?

You might have something like this?

<servlet-mapping>
  <servlet>dispatcher</servlet>
  <url-pattern>/*</url-pattern>
</servlet-mapping>

尝试使用其他扩展名(例如.do)调用控制器,并更新servlet映射以适合

Try calling your controllers with a different extension (.do for example) and update the servlet-mapping to suit

 <servlet-mapping>
  <servlet>dispatcher</servlet>
  <url-pattern>*.do</url-pattern>
</servlet-mapping>

这篇关于找不到带有URI [/WEB-INF/pages/apiForm.jsp]的HTTP请求的映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 06:18