How can I pass the parameter value in the result type=”stream” action?
<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>
I am trying to call the action via javascript from Entry.jsp page.
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();
}
If I call this action like below, I can get the entryId from the print action. No need to pass the value.
function print()
{
//print function
document.chooseDates.action = 'print.action';
document.chooseDates.submit();
}
I want to pass the value of entryId to the print action. I can see the value of entryId in the previous action. This print action is called when clicking on the button. But when print action is called, the entryID value becomes 0. Both action classes have getters and setters for entryId. Is there anyway to pass those value?
Once the action execution is done all objects in the valuestack will be nullified, if you want to access data from provious action you can use following