Hi,
We are extracting data from database tables and displaying that data in Table format on
JSP page. We need to export that data to Excel file in the same format.
For that we also need to display �open/save dialogue box�.
I have written a trial code for same in plain JSP which is working properly.
But in our application we are using struts-portlet framework for which the same code is not working.
For this we have a link �Download File� on the page where we are displaying table.
<html:link page="/jsp/ebip/ebipadmin/applicationadmin/reports/ExlListByApp.jsp">Download File</html:link> File �ExlListByApp.jsp� contains the following code �
We are getting an exception when it tries to execute following code snippet �
The Exception that we are getting is as follows � (This is just a small part of the stack.)
Nested Exception is java.lang.IllegalArgumentException: application/vnd.ms-excel
at org.apache.pluto.core.impl.RenderResponseImpl.setContentType(RenderResponseImpl.java:151)
at javax.servlet.ServletResponseWrapper.setContentType(ServletResponseWrapper.java:164)
at org.apache.jsp._ExlListByApp._jspService(_ExlListByApp.java:78)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:683)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:257)
at org.apache.pluto.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:112)
at com.ibm.wps.standard.struts.util.WpsStrutsUtil.include(WpsStrutsUtil.java:2092)
at com.ibm.portal.struts.command.StrutsViewJspCommand.includeURL(StrutsViewJspCommand.java:186)
at com.ibm.portal.struts.command.StrutsViewJspCommand.execute(StrutsViewJspCommand.java:154)
at com.ibm.wps.standard.struts.util.WpsStrutsUtil.executeCommand(WpsStrutsUtil.java:1270)
at com.ibm.wps.standard.struts.util.WpsStrutsUtil.executeCommand(WpsStrutsUtil.java:1229)
at com.ibm.wps.standard.struts.util.WpsStrutsUtil.executeSavedCommand(WpsStrutsUtil.java:1144)
at com.ibm.portal.struts.portlet.StrutsPortlet.doService(StrutsPortlet.java:1128)
at com.ibm.portal.struts.portlet.StrutsPortlet.doView(StrutsPortlet.java:1182)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:235)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:163)
Any help would be appreciated