The following comment has been added to this issue: Author: Keith Garry Boyce Created: Sat, 9 Oct 2004 8:53 PM Body: FYI for previous displaytag 1.1 tld I was getting following warnings **** Warning Sat Oct 09 20:37:46 EDT 2004 1097368666945 /atg/dynamo/service/j2ee/WebContainer Attribute "className" of tag "table" in taglib descriptor file "/WEB-INF/displaytag-11.tld" must have a corresponding property in class "org.displaytag.tags.TableTag" with a public setter method **** Warning Sat Oct 09 20:37:46 EDT 2004 1097368666965 /atg/dynamo/service/j2ee/WebContainer Attribute "className" of tag "column" in taglib descriptor file "/WEB-INF/displaytag-11.tld" must have a corresponding property in class "org.displaytag.tags.ColumnTag" with a public setter method **** Warning Sat Oct 09 20:37:46 EDT 2004 1097368666985 /atg/dynamo/service/j2ee/WebContainer Attribute "className" of tag "caption" in taglib descriptor file "/WEB-INF/displaytag-11.tld" must have a corresponding property in class "org.displaytag.tags.CaptionTag" with a public setter method --------------------------------------------------------------------- View this comment: http://jira.codehaus.org/browse/DISPL-30?page=comments#action_25159
--------------------------------------------------------------------- View the issue: http://jira.codehaus.org/browse/DISPL-30 Here is an overview of the issue: --------------------------------------------------------------------- Key: DISPL-30 Summary: Spring Interceptor for use with servlet 2.2 containers Type: New Feature Status: Unassigned Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: DisplayTag Components: Export Versions: 1.0 RC1 Assignee: Reporter: fabrizio giustina Created: Sat, 2 Oct 2004 4:13 AM Updated: Sat, 9 Oct 2004 8:53 PM Description: Se http://forum.springframework.org/viewtopic.php?t=1004 and displaytag-user mailing list Boyce, Keith Garry I developed an interceptor to use instead of responseOverrideFilter for use in Servlet 2.2 containers with ServletWrapperController (posted on jira). Please give me credit in javadoc if you decide to use it. Here is the code: Code: /* * DisplayTagInterceptor.java * * Copyright 2004 by Electronic Data Systems * Corporation. All rights reserved. * * An unpublished work created Sep 26, 2004, 2004. This work is a * trade secret of EDS and unauthorized use or copying * is prohibited. * */ package org.springframework.web.servlet.mvc; import java.io.PrintWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.displaytag.filter.BufferedResponseWrapper; import org.displaytag.tags.TableTag; import org.displaytag.tags.TableTagParameters; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.HandlerAdapter; /** * @author jztb88 * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class DisplayTagInterceptor implements HandlerInterceptor { final static Log log = LogFactory.getLog(DisplayTagInterceptor.class); /* (non-Javadoc) * @see org.springframework.web.servlet.HandlerInterceptor#preHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object) */ public boolean preHandle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Object handler) throws Exception { if (servletRequest.getParameter(TableTagParameters.PARAMETER_EXPORTING) == null) { if (log.isDebugEnabled()) { log.debug("Filter has been called, but PARAMETER_EXPORTING parameter has not been found."); } return true; } HttpServletRequest request = (HttpServletRequest) servletRequest; BufferedResponseWrapper wrapper = new BufferedResponseWrapper((HttpServletResponse) servletResponse); // In a portlet environment, you do not have direct access to the actual request object, so any attribute that // is added will not be visible outside of your portlet. So instead, users MUST append to the StringBuffer, so // that the portlets do not have to bind a new attribute to the request. request.setAttribute(TableTag.FILTER_CONTENT_OVERRIDE_BODY, new StringBuffer(8096)); request.setAttribute(TableTag.FILTER_CONTENT_OVERRIDE_TYPE, new StringBuffer(80)); request.setAttribute(TableTag.FILTER_CONTENT_OVERRIDE_FILENAME, new StringBuffer(80)); HandlerAdapter handlerAdaptor = new SimpleControllerHandlerAdapter(); handlerAdaptor.handle(request,wrapper,handler); String pageContent; String contentType; StringBuffer buf = (StringBuffer) request.getAttribute(TableTag.FILTER_CONTENT_OVERRIDE_BODY); HttpServletResponse resp = (HttpServletResponse) servletResponse; String characterEncoding = resp.getCharacterEncoding(); if (characterEncoding != null) { characterEncoding = "; charset=" + characterEncoding; } if (buf != null && buf.length() > 0) { pageContent = buf.toString(); contentType = ObjectUtils.toString(request.getAttribute(TableTag.FILTER_CONTENT_OVERRIDE_TYPE)); if (log.isDebugEnabled()) { log.debug("Overriding output, writing new output with content type " + contentType); } StringBuffer filename = (StringBuffer) request.getAttribute(TableTag.FILTER_CONTENT_OVERRIDE_FILENAME); if (filename != null && StringUtils.isNotEmpty(filename.toString())) { if (log.isDebugEnabled()) { log.debug("Filename specified as " + filename); } resp.setHeader("Content-Disposition", "attachment; filename=\"" + filename + "\""); } } else { log.debug("NOT overriding input. "); pageContent = wrapper.toString(); contentType = wrapper.getContentType(); } if (contentType != null) { if (contentType.indexOf("charset") > -1) { // charset is already specified (see #921811) servletResponse.setContentType(contentType); } else { servletResponse.setContentType(contentType + StringUtils.defaultString(characterEncoding)); } } servletResponse.setContentLength(pageContent.length()); PrintWriter out = servletResponse.getWriter(); out.write(pageContent); out.close(); return false; } /* (non-Javadoc) * @see org.springframework.web.servlet.HandlerInterceptor#postHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.web.servlet.ModelAndView) */ public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3) throws Exception { // Nothing to do } /* (non-Javadoc) * @see org.springframework.web.servlet.HandlerInterceptor#afterCompletion(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, java.lang.Exception) */ public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3) throws Exception { // Nothing to do } } --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel