April 2005


Programming21 Apr 2005 10:17 am

After a change in a JSP web application’s web.xml file to enable filters in the displaytag taglib, I needed to reload the web.xml file to make the changes live. There are a couple of ways to go about this: Restart tomcat or reload the web application or remove then reinstall the web application using the tomcat web manager. I chose to restart tomcat since for my setup I don’t have access to the web manager but have easy access to the stop and start .sh scripts. Either way works fine though.

del.icio.us:Reload JSP Tomcat Web Application web.xml File digg:Reload JSP Tomcat Web Application web.xml File spurl:Reload JSP Tomcat Web Application web.xml File wists:Reload JSP Tomcat Web Application web.xml File simpy:Reload JSP Tomcat Web Application web.xml File newsvine:Reload JSP Tomcat Web Application web.xml File blinklist:Reload JSP Tomcat Web Application web.xml File furl:Reload JSP Tomcat Web Application web.xml File reddit:Reload JSP Tomcat Web Application web.xml File fark:Reload JSP Tomcat Web Application web.xml File blogmarks:Reload JSP Tomcat Web Application web.xml File Y!:Reload JSP Tomcat Web Application web.xml File smarking:Reload JSP Tomcat Web Application web.xml File magnolia:Reload JSP Tomcat Web Application web.xml File segnalo:Reload JSP Tomcat Web Application web.xml File
Programming21 Apr 2005 10:10 am

One of my sites uses the displaytag taglib to format an Oracle result set. I recently tried to add on the export functionality to one of the pages but received this error:

Unable to reset response before returning exported data. You are not using an export filter. Be sure that no other jsp tags are used before display:table or refer to the displaytag documentation on how to configure the export filter (requires j2ee 1.3).

After doing some searching I found that there was not very much info out there but the solution is fairly simple and really is defined by the error message. You need to configure the export filter in your web.xml document. OK, but HOW do you do that? Below are the lines I added to my web.xml file to enable the displaytag export filters.


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

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

Then all I had to do was make sure that the JSP web application was reloaded in Tomcat. (See the other post on how to reload the web.xml file). This solution allows you to have JSP tags above your main displaytag table tag. This is very necessary in most applications which do preliminary processing, such as retrieving a dataset, checking login status, etc.

del.icio.us:JSP displaytag Excel Filter Error digg:JSP displaytag Excel Filter Error spurl:JSP displaytag Excel Filter Error wists:JSP displaytag Excel Filter Error simpy:JSP displaytag Excel Filter Error newsvine:JSP displaytag Excel Filter Error blinklist:JSP displaytag Excel Filter Error furl:JSP displaytag Excel Filter Error reddit:JSP displaytag Excel Filter Error fark:JSP displaytag Excel Filter Error blogmarks:JSP displaytag Excel Filter Error Y!:JSP displaytag Excel Filter Error smarking:JSP displaytag Excel Filter Error magnolia:JSP displaytag Excel Filter Error segnalo:JSP displaytag Excel Filter Error