Tuesday, April 26, 2011

workaround for sitemesh decoration of servlet error

Reference : workaround for sitemesh decoration of servlet error

workaround filter :

public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) 
 throws ServletException, IOException { 
        HttpServletRequest request = (HttpServletRequest)servletRequest; 
        request.removeAttribute("com.opensymphony.sitemesh.APPLIED_ONCE"); 
        filterChain.doFilter(servletRequest, servletResponse); 
} 

web.xml :

<filter> 
        <filter-name>clearSiteMeshAppliedOnce</filter-name> 
        <filter-class>ClearSitemeshAppliedOnceFilter</filter-class> 
</filter> 
<filter-mapping> 
        <filter-name>clearSiteMeshAppliedOnce</filter-name> 
        <url-pattern>*</url-pattern> 
        <dispatcher>ERROR</dispatcher> 
</filter-mapping>

No comments:

Post a Comment