• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Help required in Exporting to Excel in Struts-Portlet

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am also getting the same error?
Can you pls post how you were able to solve this issue?

regards,
hari
reply
    Bookmark Topic Watch Topic
  • New Topic