struts2中action的几个示例
<action name="details" method="showDetails"> <result name="自定义的返回字符串1">/WEB-INF/management/info1.jsp</result> <result name="自定义的返回字符串2">/WEB-INF/management/info2.jsp</result> <result name="自定义的返回字符串3">/WEB-INF/management/info3.jsp</result> <result name="error">error.jsp</result> </action>
<action name="deviceJson" method="findDevicesByOffice"> <result type="stream"> <param name="contentType">text/html</param> <param name="inputName">inputStream</param> </result> <result name="error">../error.jsp</result> </action>
<action name="generateCfg" method="generateConfig"> <result name="success" type="stream"> <!-- 下载文件类型定义 --> <param name="contentType">text/plain</param> <!-- 下载文件处理方法 --> <param name="contentDisposition">attachment;filename="${fileName}"</param> <!-- 下载文件输出流定义 --> <param name="inputName">downloadFile</param> </result> <result name="error">error.jsp</result> </action>