1

我开发了一个spring boot应用程序并部署在外部tomcat上。我面临的是当我通过上下文路径调用应用程序时 tomcat 抛出异常。

控制器

@GetMapping(value="/",  produces = "text/html;charset=UTF-8")
    public String loadIndexPage() { 
        return "index";
    }

pom.xml

<build>
    <finalName>apluscontent</finalName>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

我希望应用程序在http://localhost:8080/apluscontent/上运行,但它会抛出异常

由于异常 [无法在 requestUri '/apluscontent/' 中找到 lookupPath '/index.html',从请求 [/index.html] 转发到错误页面。路径是否包含用于 characterEncoding 'UTF-8' 的无效编码字符?]

java.lang.IllegalStateException:无法在 requestUri '/apluscontent/' 中找到 lookupPath '/index.html'。路径是否包含用于 characterEncoding 'UTF-8' 的无效编码字符?

4

0 回答 0