I have reportCriteria.jsp as follows:
<s:form action="showPdf" theme="css_xhtml" cssClass="form1small" name="reportgenerationform">
<div id="searchHeaderReport">Generate Report</div>
<div id="searchForm1">
<s:select list="#application.proList" headerValue="Select" headerKey="select" label="Provider" id="providerId" name="providerName"></s:select>
<div id="wwgrp_flightId" class="wwgrp">
<div id="wwerr_showPdf_flightId" class="wwerr">
<div class="errorMessage">
</div>
</div>
<div id="wwlbl_flightId" class="wwlbl">
<label class="label" for="flightId"> Flight ID: </label>
</div>
<div id="wwctrl_flightId" class="wwctrl">
<select id="flightId" name="flightId">
<option selected="selected">select</option>
</select>
</div>
</div>
<div id="wwgrp_scheduleId" class="wwgrp">
<div id="wwerr_showPdf_flightId" class="wwerr">
<div class="errorMessage">
</div>
</div>
<div id="wwlbl_flightId" class="wwlbl">
<label class="label" for="scheduleId"> Schedule ID: </label>
</div>
<div id="wwctrl_flightId" class="wwctrl">
<select id="scheduleId" name="scheduleId">
<option selected="selected">select</option>
</select>
</div>
</div>
</div>
<div id="submitdivid">
<sj:submit value="Generate Report" cssClass="orangebuttonsmall"/>
</div>
</s:form>
The struts.xml mapping is as follows:
<action name="showPdf" class="com.view.ReportAction" method="showReport">
<result name="report" type="stream">
<param name="inputName">fileStream</param>
<param name="contentType">application/pdf</param>
<param name="contentDisposition">attachment;filename="PDF_Report.pdf"</param>
</result>
<result name="input">/reportCriteria.jsp</result>
</action>
<action name="flightMgmt" class="com.view.AdminAction" method="flightMgmt">
<result name="flightMgmtClicked">/flightMgmt.jsp</result>
</action>
<action name="reportGeneration" class="com.view.AdminAction" method="reportGeneration">
<result name="reportGenerationClicked">/reportCriteria.jsp</result>
</action>
Now if the method showReport returns "report", then the pdf content is loaded in encrypted form in div with id as "report_generation". When the method returns input, then it loads reportCriteria.jsp with errors in the div with id as "report_generation".
What i want to do is that when it returns error then the jsp must be loaded into that div but if the method returns "report" which it returns on success, then the file download box must appear as shown in result type="report" in struts.xml.
The following is "loginSuccessAdmin.jsp" that contains "report_generation" div :*
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:url var="remoteurl1" action="flightMgmt"/>
<s:url var="remoteurl2" action="reportGeneration"/>
<s:url var="remoteurl3" action="dealMgmt"/>
<sj:tabbedpanel id="remotetabs" selectedTab="0" collapsible="true">
<sj:tab id="tab1" href="%{remoteurl1}" label="Flight Management"/>
<sj:tab id="tab2" href="%{remoteurl2}" label="Report Generation"/>
<sj:tab id="tab3" href="%{remoteurl3}" label="Deal Management"/>
</sj:tabbedpanel>
</div>
The line <sj:tab id="tab2">
itself creates a div with id as report_generation.
Is there anything possible, that may accomplish my purpose.. Thanks in advance