I am using Struts2 and Liferay for developing an application.
My struts.xml
is as follows:
<action name="download" class="com.stp.portal.view.DownloadAction">
<result name="success" type="stream">
<param name="contentType">application/pdf</param>
<param name="inputName">fileInputStream</param>
<param name="contentDisposition">attachment;filename="abc.pdf"</param>
<param name="bufferSize">1024</param>
</result>
</action>
I basically want to download a pdf file from the server. But I get the following error:
10:05:55,782 ERROR [Jsr168Dispatcher:38] Could not execute action java.lang.IllegalArgumentException: application/pdf is not a supported mime type at com.liferay.portlet.MimeResponseImpl.setContentType(MimeResponseImpl.java:159)...
Don't know how to resolve this. Would really appreciate someone's help. Really need this to be done.
Jsr286Dispatcher
? – NorvunJsr286Dispatcher
extendsJsr168Dispatcher
so it class name maybe used in logs. – Norvun