读书人

Spring Json View之高速开始(二)

发布时间: 2012-10-31 14:37:32 作者: rapoo

Spring Json View之快速开始(二)

快速开始-用SimpleForm-Controller提交GET/POST请求
?
?Command-Controller提供一个完整的CommandBean,Spring对它提供校验和绑定支持。这个示例在Command-Controller中返回一个Model-Map的Json字符串,json视图返回信息中包含字段错误、全局错误和绑定。支持CommandBean属性类型的转换。

通过formBackingObject方法触发GET请求。通过onSubmitAction方法出发POST请求。

?

详细信息参见文档


?
Spring ApplicationContext
?

?

Spring view.xml

?

JavaScript behaviour-roles.js

?

CommandBean

?

Response-Status : 311{ "failure":"true", "exception.message":"java.lang.Exception: You throw an exeption !", "exception.stacktrace": "java.lang.Exception: You throw an exeption ! \n\tat org.thing.spring.json.controller.[...] \n\tat org.springframework.web.servlet.mvc.[...] [...]"}
?

读书人网 >JavaScript

热点推荐