It's not a secret anymore!*
The moose likes Struts and the fly likes Struts2 with Displaytag export option is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 with Displaytag export option is not working" Watch "Struts2 with Displaytag export option is not working" New topic
Author

Struts2 with Displaytag export option is not working

Nirmal Jatania
Greenhorn

Joined: Apr 17, 2009
Posts: 19
Hello All,

I am using Displaytag framework for pagination & exporting purpose. In that i am also using Strut2Tiles Integration.

Whenever i am calling any action class it will returning me a list & through Displaytag i am successfully displaying record on my page. For that my jsp page's code looks like :



Actually this page is displaying through tiles configuration.

Here i have enabled the export option, so it is showing me the exporting options like CSV, EXCEL, XML. But whenver i am clicking on that CSV link, my web browser hanged, means nothing is displayed on it

For that exporting solution i have also added filter in my web.xml. My web.xml looks like:



he exception that i am getting is :


I have also included following list of libraries of displaytag : 1) displaytag-1.2.jar 2) displaytag-export-poi-1.2.jar 3) displaytag-portlet-1.2.jar

Please reply, i am stuck with this problem.
Nirmal Jatania
Greenhorn

Joined: Apr 17, 2009
Posts: 19
Hello All,

I am using Displaytag framework for pagination & exporting purpose. In that i am also using Strut2Tiles Integration.

Whenever i am calling any action class it will returning me a list & through Displaytag i am successfully displaying record on my page. For that my jsp page's code looks like :



Actually this page is displaying through tiles configuration.

Here i have enabled the export option, so it is showing me the exporting options like CSV, EXCEL, XML. But whenver i am clicking on that CSV link, my web browser hanged, means nothing is displayed on it

For that exporting solution i have also added filter in my web.xml. My web.xml looks like:



I have also included following list of libraries of displaytag : 1) displaytag-1.2.jar 2) displaytag-export-poi-1.2.jar 3) displaytag-portlet-1.2.jar

Please reply, i am stuck with this problem.
Anant Joshi
Greenhorn

Joined: May 13, 2009
Posts: 3
Hello Nirmal,

You just have to change the order of the filters in web.xml file and set the displaytag filter first like

<filter>
<filter-name>ResponseOverrideFilter</filter-name>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>ResponseOverrideFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>ResponseOverrideFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>


<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

Set ResponseOverrideFilter before the struts2 FilterDispatcher .


Regards,
Anant Joshi


siva np
Greenhorn

Joined: Feb 12, 2009
Posts: 9
Hi Nirmal,

I am using struts 2, display tag sample.

The following code will be the list.jsp



the web.xml will be



Using the above code, i can export the files.

Did you use the pagination in the action file ?

Did you edit the web page in the same page ?

If you answer is yes, then send me the code ?

I am also struggling in pagination, edit page using display tag

Thanks & Regards,

Siva NP
 
wood burning stoves
 
subject: Struts2 with Displaytag export option is not working