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)
Do non-page (or alias) URLs flow through the site precontrollers?
Bowker
I would like to have ALL URLs that hit our LSDS server trigger the running of the site's pre-controllers.
Use case: We are retiring (99% retiring) one of our web sites and moving all the content to another server. Of course all the URLs are different. Some we want to direct to new URLs, others we want 404 and some, for legal reasons, we need to leave alone and the content must be presented with a 200 response code.
I have written a precontroller to do this, but when I send ****/yyy.jsp and ****/yyy.pdf to LiveSite, the controller doesn't execute.
Is this possible?
I have a backup plan, but it's UGLY.
Find more posts tagged with
Comments
Rick Poulin
You'd need to write this as a Servlet Filter if you want it to hit all URLs, not just pages and aliases. You probably *could* then dispatch that call to a PreController class, but you'll have just the HttpServletRequest object as input, not a RequestContext.. So if most of the code is reusable anyway, you can refactor your class and add a method that takes a request object. Whether you make this configurable via the default.site is an ROI question that probably leans towards the "don't bother" side.
Bowker
Thanks. Came to the realization on Sunday. I converted what I had from a pre-controller to a tomcat filter and it is going to work like a charm.
Thanks