我的应用程序是使用spring框架开发的.我使用spring框架创建了一个新的rest webservice.

@Controller

public class MyTestController {

@Inject

private MyService service;

@RequestMapping(value = "/acc/Status/{accNum}",method = RequestMethod.GET)

@ResponseBody

public String getAccStatus(@PathVariable final String accNum,final HttpServletResponse response) throws Exception

{

//logic goes here

return "success";

}

为MyService:

public interface BusinessCalendarService {

//methods..

}

HTTP Status 401 - Full authentication is required to access this resource

现有的控制器工作正常,它与我的控制器显示上述消息.请建议我是否需要进行任何代码修改?我按照与编写其他控制器相同的方式进行操作.

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐