當前位置:編程學習大全網 - 網站源碼 - 在idea中使用SpringMVC框架的時候,報如下錯誤,spring-web和spring-webmvc包我都用maven依賴進去了

在idea中使用SpringMVC框架的時候,報如下錯誤,spring-web和spring-webmvc包我都用maven依賴進去了

應該是沒有在配置文件中聲明'HEAD',在配置文件中加入下面的代碼試試:

[html] view plaincopyprint?

<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

<property name="urlMap">

<map>

<entry "/請求的文件路徑/**" value="myResourceHandler" />

</map>

</property>

<property name="order" value="" />

</bean>

<bean id="myResourceHandler" name="myResourceHandler"

class="org.springframework.web.servlet.resource.ResourceHttpRequestHandler">

<property name="locations" value="/請求的文件路徑/" />

<property name="supportedMethods">

<list>

<value>GET</value>

<value>HEAD</value>

<value>POST</value>

</list>

</property>

</bean>

  • 上一篇:奇跡mu戰士如何設置2連擊
  • 下一篇:c語言單片機編程中,怎樣將壹個串口的到得字符串賦值給壹個數組
  • copyright 2024編程學習大全網