How to view the file without downloading in java using struts frame work? For example in Gmail we view files/resumes in canvas later we download.
JSP:
<div class="modal fade" id="addAttachmentDialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<s:form action="add_attachment_form_submit" name="add_attachment_form" theme="simple" id="edit_add_attachment_form_id" enctype="multipart/form-data" method="POST">
<input type="hidden" name="partyId" id="edit_partyId" value="<%= partyId%>" />
<div class="modal-content">
<div class="modal-header">
<button type="button" title="close" class="close" data-dismiss="modal">×</button>
<h3>Upload Attachment</h3>
</div>
<div class="modal-body">
<table style="table-layout:fixed;width:100%;">
<tr>
<td width="30%">
<label class="control-label" for="edit_referral_source_name">Choose File<span title="Required Field" class="required-marker">*</span>
</label>
</td>
<td width="70%">
<%-- <s:file name="fileUpload" label="Select a File to upload" size="40" />--%>
<%-- <div id="file_upload-button" class="uploadify-button " style="height:80%; line-height:250%; width:22%;"><span class="uploadify-button-text" for="edit_referral_source_name">Choose File</span> --%>
<!-- </div> -->
<div><s:file name="fileUpload" id="edit_add_attachment_form_id_fileUpload" cssClass="custom-file-input" label="Select a File to upload" size="40" />
</div>
<!-- <input type="file" label="Select a File to upload" class="uploadify-button"size="40"/>--></td>
</tr>
<tr>
<td></td>
<td height="26"><span style="font-size:11px">The Upload Attachment Should Not Exceed 3MB Size.</span>
</td>
</tr>
<tr>
<td height=6></td>
</tr>
<tr>
<td>
<label class="control-label" for="edit_referral_source_name">Attachment Name</label>
</td>
<td><s:textfield cssClass="form-control" maxlength="128" style="width:99%" name="attachmentName" id="edit_attachmentName" size="20" value="%{attachmentName}" />
</td>
</tr>
<tr>
<td height=6></td>
</tr>
<tr>
<td>
<label class="control-label" for="edit_referral_source_name">Attachment Type</label>
</td>
<td>
<div class="controls" style="width:62%">
<s:select name="chosenAttachmentType" data-rel="chosen" label="" class="required-marker" id="edit-attachmentType" headerKey="1" list="%{attachmentType}" value="%{chosenAttachmentType}"></s:select>
</div>
</td>
</tr>
<tr>
<td height=6></td>
</tr>
<tr>
<td>
<label class="control-label" for="edit_referral_source_name">Attachment Description</label>
</td>
<td><s:textarea cssClass="form form-control autogrow" style="min-width: 382px !important; max-width:382px !important; height: 60px;" name="attachmentDescription" id="edit_attachmentDescription" value="%{attachmentDescription}" />
</td>
</tr>
</table>
<button class="btn btn-success btn-sm" title="Upload" style="margin-left:68%;margin-right: 1.5%;height:30%;margin-top:6%;margin-bottom:3%;color:white;background-color:#38976D!important;" type="submit" name="add_attachment_submit_button447" onclick="this.disabled=true;this.value='processing'" id="edit_add_attachment_submit_button"><i class="glyphicon glyphicon-upload" id="add_button_icon_id" style="padding-bottom: 12%;"></i><span id="add_button_span_id"> Upload</span>
</button>
<button class="btn btn-default" style="height:30%;margin-top:6%;margin-bottom:3%;" title="Cancel" type="button" id="edit_cancel_account_button_bottom" name="cancel_account_button_bottom" onClick="javascript:window.location='view_party?partyId=<%=partyId %>';"><i class="glyphicon glyphicon-remove" id="cancel_button_icon_id"></i><span id="cancel_button_span_id"> Cancel</span>
</button>
</div>
<div class="modal-footer"></div>
</div>
</s:form>
</denter image description hereiv>
</div>