我休息控制器,這是由春寫的,返回404,但是當我在調試的Eclipse,我看到它來到我的方法,並返回結果,但結果仍是404彈簧安置控制器返回404
控制器是如:
@RestController
@RequestMapping("admin/context")
public class ApplicationAdmin {
@Autowired
private ApplicationContextService applicationContextService;
@RequestMapping(value="/monitor",method = RequestMethod.GET, produces = "application/json")
@ResponseStatus(HttpStatus.OK)
public Response monitorContexts(){
return this.applicationContextService.monitorContext();
}
}
沒有例外或錯誤。並且請求UR是:
http://localhost:8080/appl_war/admin/context/monitor
它是不能夠找到控制器。什麼是cmsgateway?不應該是http:// localhost:8080/appl_war/admin/context/monitor? –
在web.xml中顯示DispatcherServlet配置。檢查您的值,如果您有** / url-pattern> **,那麼您的網址應爲http:// localhost:8080/appl_war/admin/context/monitor –
已編輯的網址。沒有cmsgateway。請求來到我的控制器方法,我可以看到。但它仍然給404 ... – Neron