阅读背景:

从Spring MVC Controller返回JSON或View

来源:互联网 

I am wanting to return a view from a Spring MVC Controller depending on logic. If an error occurs I want to return JSON, if not, an HTML view. This is like ASP.NET MVC ActionResult, where you can return any kind of view and it will render the result, and it won't depend on the content-type being sent in the request. I can't find any examples of this.I am wanting to return a view from a Spring MVC




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: