小编Vat*_*son的帖子

Spring Boot 应用程序不会熬夜

我创建了一个简单的 REST Spring 启动应用程序。我看到它开始,但它立即关闭。日志中没有错误。

下面是代码和日志。

代码:

@Controller
@ComponentScan
@EnableAutoConfiguration 
@RequestMapping("userInfo")
public class UserUpdateService
{
    private java.util.logging.Logger logger = Logger.getLogger("UserUpdateService");

    @RequestMapping(value="/{userId}", method=RequestMethod.GET, produces = "application/xml; charset=utf-8")
    @ResponseBody
    String getUserInfo(@PathVariable String userId)
    {
        String func = "getUserInfo";
        logger.entering("UserUpdateService", func);

        String retval = "";
        return retval;
    }

    @RequestMapping(value="/{userId}", method=RequestMethod.DELETE, produces = "application/xml; charset=utf-8")
    @ResponseBody
    String removeUser(@PathVariable String userId)
    {
        String retval = "";
        String func = "removeUser";

        logger.entering("UserUpdateService", func);
        return retval;
    }

    @RequestMapping(value="/", method=RequestMethod.PUT, produces = "application/xml; charset=utf-8")
    @ResponseBody
    String addUser(@WebParam (name = …
Run Code Online (Sandbox Code Playgroud)

rest spring spring-boot

6
推荐指数
1
解决办法
2039
查看次数

标签 统计

rest ×1

spring ×1

spring-boot ×1