Fra83 Posted October 25, 2013 Share Posted October 25, 2013 Hello,I have a problem with my java web application (WebLogic 10.3.5, Spring 3.1 and Jasper 5.0.1) I want to export an excel report, but at the end of operation, jasper download dialog not appear. In Tomcat AS everything works, but not in WebLogic.Jsp code with export button:<a title="Export" href="javascript:window.location.replace('<%=path %>/admin/export.com');">Export</a>[/code]Spring MVC Controller:@RequestMapping("/export.com")public ModelAndView exportAction(@ModelAttribute("model") UserModel model, HttpServletRequest request) throws Exception{ SearchBean searchForm = model.getSearchForm(); Map<String,Object> parameterMap = new HashMap<String,Object>(); List<User>usersList = iReportService.getUsers(searchForm,null).getResults(); JRDataSource JRdataSource = new JRBeanCollectionDataSource(usersList); parameterMap.put("datasource", JRdataSource); return new ModelAndView("XlsUserReport",parameterMap);}[/code]pom.xml<dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> <version>5.0.1</version> <exclusions> <exclusion> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> </exclusion> <exclusion> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> </exclusion> </exclusions></dependency><dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.7.0</version></dependency><dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.6</version> <type>jar</type> <scope>compile</scope></dependency>[/code]fe-servlet.xml<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass"> <value>org.springframework.web.servlet.view.tiles2.TilesView</value> <property name="order" value="1"/> </property></bean><bean class="org.springframework.web.servlet.view.XmlViewResolver"> <property name="location" value="/WEB-INF/report.xml"/> <property name="order" value="0"/></bean>[/code]report.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> <bean id="XlsUserReport" class="org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView" p:url="classpath:report/report/user.jrxml" p:reportDataKey="datasource"> <property name="headers"> <props> <prop key="Content-Disposition"> attachment; filename=users.xls </prop> </props> </property> </bean></beans>[/code]In the same spring context I use two different resolver (UrlBasedViewResolver and XmlViewResolver) so maybe this can create problems.As I said, in tomcat AS, jasper download dialog appear, but when I deploy my web application in WebLogic, after export click a blank page appear (the URL is .../export.com) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now