我创建了一个简单的 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)