其次是这个Action没有办法自动从请求中将json串解析为java的域,同样,如果需要将json串写入响应的话,也需要自行编码 另一个办法,是使用struts2-json-plugin,将jar包拷贝入 这样访问也没什么不可以,只是不太实用,相当于把Action当做加强版的Servlet来用了 json只是一种数据格式,在同步请求中用json来交换数据,也是一种很常见的做法,并不一定用在ajax里 所以struts2
dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2
dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2
JSON 导入依赖 <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2
version}</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2