用配置文件的时候是这样写的
<result type="json">
<param name="contentType">text/html</param>
<param name="root">msg</param>
</result>
可是用注解方式之后这个param怎么写呢?org.apache.struts2.convention.annotation这个包下没有Param这个类,注解没法写param啊,有什么解决方法呢?
Spring Struts JSON
------解决方案--------------------
给个例子:
@Action(value="showSmallImg", results={@Result(name="smallImg", type="stream", params={"contentType","image/jpeg","inputName","${smallImg}","bufferSize","1024"})})