DispatcherServlet无法启动

当我使用Tomcat启动我的应用程序时,只能使用index.jsp,但是当我尝试从控制器(re.sub Python documentation)获取请求时,它会返回404错误,例如DispatcherServlet没有启动 web.xml 我不明白为什么它不起作用

\2

dispatcherServlet-servlet.xml

df['dates'] = df['dates'].str.replace(r'([/ ])(\d\d)$',r'\g<1>19\2')
df['dates'] = df['dates'].str.replace(r'(?<=[/ ])(?=\d\d$)','19')

控制器-App.java

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">

    <servlet>
        <servlet-name>dispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcherServlet</servlet-name>
        <url-pattern>/dictionary</url-pattern>
    </servlet-mapping>
</web-app>

build.gradle

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns = "http://www.springframework.org/schema/beans"
       xmlns:context = "http://www.springframework.org/schema/context"
       xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation = "http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:annotation-config/>
    <context:component-scan base-package = "com.example.dictionary" />


</beans>
pipi0462 回答:DispatcherServlet无法启动

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3144818.html

大家都在问