Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Adding a servlet filter
Emer
Hi,
I need to add a servlet filter for sitepublisher / Livesite. Do I have to override the com.interwoven.livesite.runtime.filter.LiveSiteFilter ?
The idea is the filter needs to process the HTML generated by livesite
1. when component is previewed
2. when page is previewed
3. when page is generated through sitepublisher menu
4. when page is generated using workflow page generation
5. dynamically at runtime before it gets cached
I tried adding a filter before the livesite filter in web.xml and defining the beans, but its not able to intercept the output from livesite.
Thanks
Find more posts tagged with
Comments
tec_iwov
your filter should be defined before the livesite filter.
are you chaining your filter call and passing on a custom response to process the out put?
protected void doFilter(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain)
throws ServletException, IOException
{
MyCustomeResponse r = new MyCustomeResponse(response);
chain.doFilter(request, response);
}
Emer
Hi,
Thanks for the reply. I tried doing that but I still can't get it to work. Yes I am using a custom response object. Just for simplicity I'm attaching the code(response-wrapper and filter) and config files (web, servlet-resource, and preview-resource).
Please can you have a look and point out what I'm doing wrong.
Thanks.
Emer
Hi,
Got this working
. For other's reference I'm attaching the code. This mockup rearranges inline style tags to the header and script tags to the bottom of page.
This could have been done by changing the xsl suitably, the mockup is just theoretical.
Regards.