我新的春天,我想学习如何使用Spring开发REST API,以便我按照这个教程:“在服务器上运行”抛出错误在Eclipse STS
https://spring.io/guides/gs/rest-service/
我点击“在服务器上运行”,当我访问“localhost:8080/greeting”时,我得到:
请求的资源不可用。
任何线索为什么?
问候
我新的春天,我想学习如何使用Spring开发REST API,以便我按照这个教程:“在服务器上运行”抛出错误在Eclipse STS
https://spring.io/guides/gs/rest-service/
我点击“在服务器上运行”,当我访问“localhost:8080/greeting”时,我得到:
请求的资源不可用。
任何线索为什么?
问候
你看过Working a Getting Started guide with STS
步骤STS运行的应用程序
如果你想要运行的应用程序与引导Building a RESTful Web Service在服务器上建造,然后阅读指南Converting a Spring Boot JAR Application to a WAR
例如,你需要添加web配置
public class HelloWebXml extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
}
如果你读你看到的这两个问题,他们是不同的.. – apinho
从第二个问题的答案是有效的。这个指南是关于创建可执行JAR的,你有可执行文件WAR吗? – MariuszS