woodripp3r Δημοσ. 18 Νοεμβρίου 2012 Δημοσ. 18 Νοεμβρίου 2012 Καλησπέρα αναδημοσιεύω το ερώτημα που έχω κάνει σε άλλη σελίδα γιατί είναι λίγο μεγαλούτσικο! i want a little help. I have a web application using Spring MVC and tiles 2 and i add displaytag yesterday but when i want to export the table in any format iget redirected to a page with the data of the table in a row. Here is my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/.../xml/ns/javaee" xmlns:xsi="http://www.w3.org/20...chema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/...b-app_2_5.xsd"> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> <filter> <filter-name>ResponseOverrideFilter</filter-name> <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class> </filter> <!-- Filter mapping for the export --> <filter-mapping> <filter-name>ResponseOverrideFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>ResponseOverrideFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <!-- Filter for the export, need that when using Struts and tiles --> <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> Here is my jsp file <%@ taglib uri="http://java.sun.com/.../jsp/jstl/core" prefix="c"%> <%@page contentType=" ;charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://www.springfra...ework.org/tags" prefix="spring"%> <%@ taglib uri="http://displaytag.sf.net" prefix="display" %> <html> <head> <title><spring:message code="label.listeggrafo" /></title> <style type="text/css"> .pagingItem { font-weight: normal; text-decoration: none; color: #747474; margin: 0 2px; padding: 0 2px; background-color: #eeeeee; border: 1px solid #bababa; font-size: 0.9em; line-height: 1.5em; } .pagingItemCurrent { padding: 0 2px; margin: 0 2px; font-weight: normal; color: #FFFFFF; background-color: #bfbfbf; border: 1px solid #bfbfbf; font-size: 0.9em; } </style> </head> <body> <h1><spring:message code="label.listeggrafo" /></h1> <display:table name="eggrafa" class="table" requestURI="" id="eggrafa" export="true" pagesize="10"> <display:column property="aa" sortable="true" href="update.html" media="html" paramId="aa" paramProperty="aa" titleKey="label.aa"/> <display:column property="diabathmisi" sortable="true" titleKey="label.diab"/> <display:column property="apostoleas" sortable="true" titleKey="label.apostol"/> <display:column property="tautotitaeg" sortable="true" titleKey="label.tauteg"/> <display:setProperty name="paging.banner.item_name"><spring:message code="label.aa" /> </display:setProperty> <display:setProperty name="paging.banner.items_name"><spring:message code="label.aa" /></display:setProperty> <display:setProperty name="export.pdf.filename" value="ActorDetails.pdf"/> <display:setProperty name="export.excel.filename" value="ActorDetails.xls"/> </display:table> </body> </html> Here is my controller @RequestMapping(value = "/listeggrafo" , method = RequestMethod.GET) public ModelAndView listeggrafo(@ModelAttribute("eggrafo") Eggrafo eggrafo,@ModelAttribute("typoi") TypoiEggrafou typoi,HttpSession session,HttpServletRequest request) { if(session.getAttribute("name")!=null){ Map<String, Object> model1 = new HashMap<String, Object>(); model1.put("eggrafa", articleService.listeggrafa(session.getAttribute("name").toString())); return new ModelAndView("listeggrafa",model1); }else{ return new ModelAndView("redirect:/articles/login.html"); } } And when i choose to export in any format nothing shown to download and only redirect me to a page http://localhost:808...&6578706f7274=1 Does anybody knows why this happens? While i was looking on the internet someone says tha it is problem with tiles. Any suggestions? Όποιος μπορεί να με βοηθήσει ας το κάνει γιατί ψάχνω ένα μήνα και δεν έχω βρεί τίποτα.. ευχαριστώ πολύ!
Προτεινόμενες αναρτήσεις
Δημιουργήστε ένα λογαριασμό ή συνδεθείτε για να σχολιάσετε
Πρέπει να είστε μέλος για να αφήσετε σχόλιο
Δημιουργία λογαριασμού
Εγγραφείτε με νέο λογαριασμό στην κοινότητα μας. Είναι πανεύκολο!
Δημιουργία νέου λογαριασμούΣύνδεση
Έχετε ήδη λογαριασμό; Συνδεθείτε εδώ.
Συνδεθείτε τώρα