如何在result type =“stream”操作中传递参数值?
<action name="print" class="mypty.EntryAction" method="print">
<result name="pdf-stream-result" type="stream">
<param name="inputName">fileStream</param>
<param name="contentType">application/pdf</param>
<param name="contentDisposition">filename=${generatedPDFFileName}</param>
<param name="entryId">entryId=${entryId}</param>
</result>
<result name="input">/entry.jsp</result>
</action>
<action name="editEntry" class="mypty.EntryAction" method="editEntry">
<result>/Entry.jsp</result>
</action>
我试图通过来自Entry.jsp页面的javascript调用该动作。
function print1()
{
var w = 1024;
var h = 800;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var url="print.action";
var uploadWindow = window.open (url, 'PrintPopUp', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=0, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
uploadWindow.focus();
}
如果我像下面这样调用此动作,我可以从print动作中获取entryId。无需传递价值。
function print()
{
//print function
document.chooseDates.action = 'print.action';
document.chooseDates.submit();
}
我想将 entryId 的值传递给打印操作。 我可以在上一个操作中看到entryId的值。单击按钮时会调用此打印操作。但是当调用print操作时,entryID值变为0.两个操作类都具有entryId的getter和setter。无论如何都要传递这些价值吗?