Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 with Displaytag export option is not working

 
Nirmal Jatania
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic