HTTP Status 500 - Servlet.init() for servlet Dispatcher threw exception

前端 未结 2 1800
猫巷女王i
猫巷女王i 2021-01-05 17:36

When I\'m trying to run this simple html form:

   
       
        Enter a new Page
       

         


        
相关标签:
2条回答
  • 2021-01-05 18:08

    You map your dispatcher on *.do:

    <servlet-mapping>
       <servlet-name>Dispatcher</servlet-name>
       <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    

    but your controller is mapped on an url without .do:

    @RequestMapping("/editPresPage")
    

    Try changing this to:

    @RequestMapping("/editPresPage.do")
    
    0 讨论(0)
  • 2021-01-05 18:19
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>teste4</groupId>
        <artifactId>teste4</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>war</packaging>
    
        <repositories>
            <repository>
                <id>prime-repo</id>
                <name>PrimeFaces Maven Repository</name>
                <url>http://repository.primefaces.org</url>
                <layout>default</layout>
            </repository>
        </repositories>
    
    
    
        <dependencies>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.2.4</version>
            </dependency>
    
    
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.2.4</version>
            </dependency>
    
    
    
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>2.5</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>jstl</artifactId>
                <version>1.2</version>
            </dependency>
            <dependency>
                <groupId>org.primefaces</groupId>
                <artifactId>primefaces</artifactId>
                <version>4.0</version>
            </dependency>
            <dependency>
                <groupId>org.primefaces.themes</groupId>
                <artifactId>bootstrap</artifactId>
                <version>1.0.9</version>
            </dependency>
            <dependency>
                <groupId>commons-fileupload</groupId>
                <artifactId>commons-fileupload</artifactId>
                <version>1.3</version>
            </dependency>
    
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.27</version>
            </dependency>
    
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>4.2.7.Final</version>
            </dependency>
    
        </dependencies>
    
    
    </project>
    
    0 讨论(0)
提交回复
热议问题