2

我已经定义了 type=steam,但它在下面的注释中抛出了错误。

@Result(name="success",type="stream" ,params={"contentType","text/html","inputName","inputStream"}).

struts.xml

 <package name="default" extends="struts-default">
 <action name="getJSON" class="com.Action" method="list">    
<result type="stream">
  <param name="contentType">text/html</param>
  <param name="inputName">inputStream</param>
</result>
</action>
</package> 

如何在注解中定义动作名称和方法?

我已经有一个注释,所以我添加了结果..

 @Results({@Result(name=com.action.Part.INPUT, value="/search.jsp",
 type= ServletDispatcherResult.class, params={"location", "/search.jsp"  }),
 @Result(name = ActionSupport.SUCCESS,type="stream",params= {"contentType","text/html","inputName","inputStream"})})
4

1 回答 1

0

因为已经导入了import org.apache.struts2.config.Result;而不是导入 org.apache.struts2.convension.annotation.Result

于 2013-06-19T00:06:29.797 回答