struts.xml片段:
<action name="printchart4Action" class="com.qx.action.PrintChart4Action">
<result name="success" type="redirect">
/printChart4.pdf?datestart=${ds}&dateend=${de}<!--很简单直接用${}就可以调用-->
</result>
<result name="input">/error.jsp</result>
</action>
Action中的代码
public class PrintChart4Action extends ActionSupport
{
private Date datestart;
private Date dateend;
private String ds;
private String de;
@Override
public String execute() throws Exception
{
ActionContext ctx=ActionContext.getContext();
SimpleDateFormat eDate= new SimpleDateFormat("yyyy-MM-dd");
this.setDs(eDate.format(datestart));
this.setDe(eDate.format(dateend));
return SUCCESS;
}