亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

PageNotFound:1136 - 在名為“spring”的 DispatcherServlet

PageNotFound:1136 - 在名為“spring”的 DispatcherServlet

慕雪6442864 2023-10-12 17:00:26
當我單擊welcome.jsp 中的任何鏈接時,我收到警告 PageNotFound:1136 - 在 DispatcherServlet 中,名稱為“spring”的 URI [/CATestSlotBooking/show] 未找到 HTTP 請求的映射。下面是控制器類@Controllerpublic class BookingSlotController {@RequestMapping(value = "/show", method = RequestMethod.GET)public String showBookingPage(ModelMap model) {    BookingSlotVO bookingDetailsVO = new BookingSlotVO();    model.addAttribute("bookingSlotVO", bookingDetailsVO);    return "booking";}調度程序 servlet MXL<?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:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc.xsd"><context:annotation-config />    <context:component-scan base-package="com.cts" /><bean id="viewResolver"  class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/views/" /><property name="suffix" value=".jsp" /></bean><bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"><property name="defaultLocale" value="en" ></property></bean><mvc:interceptors><bean id="localChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"><property name="paramName" value="lang" /></bean></mvc:interceptors></beans>
查看完整描述

1 回答

?
BIG陽

TA貢獻1859條經驗 獲得超6個贊

<welcome-file-list>從 web.xml 中刪除。


更新后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_2_5.xsd"

id="WebApp_ID" version="2.5">

<display-name>OnlineTestSlotBooking</display-name>

<servlet>

    <servlet-name>spring</servlet-name>

    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

    <load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

    <servlet-name>spring</servlet-name>

    <url-pattern>/</url-pattern>

</servlet-mapping>


</web-app>


查看完整回答
反對 回復 2023-10-12
  • 1 回答
  • 0 關注
  • 92 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號