gpt4 book ai didi

java - 如何设置spring dispatcherServlet路径?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:10:18 25 4
gpt4 key购买 nike

我使用 application.properties 文件来设置 DispatcherServlet 路径:

server.servlet.path=/api/

当我转到 url /api/ 时,出现此异常:

Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'servlet[path]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Bean property 'servlet[path]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:731)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:948)
... 59 common frames omitted

如何设置DispatcherServlet路径?

最佳答案

你可以随时查看the Spring properties appendix查找您想要的特性:

server.servlet-path=/ # Path of the main dispatcher servlet.

关于java - 如何设置spring dispatcherServlet路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46501311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com