【问题标题】:Can't access resources on tomcat server无法访问tomcat服务器上的资源
【发布时间】:2021-11-05 02:14:27
【问题描述】:

我使用 tomcat 在 IntelliJ 中创建了一个简单的web-service
尽管 tomcat 运行没有任何错误,但我无法访问资源。

Tomcat 配置:

代码-

    @Path("/hello-world")
    public class HelloResource {
    @GET
    @Produces("text/plain")
    public String hello() {
        return "Hello, World!";
    }
}

错误-

查看“Hello World”的正确 URL 是什么?

【问题讨论】:

  • 可能是http://localhost:8080/hello-world ...

标签: java web-services tomcat intellij-idea jakarta-ee


【解决方案1】:

“/”路径中没有任何资源。试试http://localhost:8080/hello-world

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-15
    • 1970-01-01
    • 2014-06-20
    • 2015-05-14
    • 2017-03-20
    • 2020-12-10
    • 1970-01-01
    相关资源
    最近更新 更多