2015-07-17 18:48 GMT+03:00 Mitch Claborn <mitch...@claborn.net>:
I spent some time yesterday digging through code without much luck. Today I'm going to experiment with this: getting a Request Dispatcher for the URL from the ServletContext, creating a dummy ServerRequest and ServerResponse object and invoking include(request, response) or forward() on that dispatcher. With luck, I'll be able to get what would be the response from a HEAD or a GET request in some sort of output stream in the response object, then examine that output stream for the result.
The way I finally solved this is a bit of a shortcut, but it works. Since our site is completely based on Struts, I'm reading the struts.xml file and matching the action names against the URL returned by google. For those that don't have a specific match, I call a routine in my "default" action that checks for various dynamically named pages (categories, products, etc). It runs super fast and doesn't need the dummy request and response objects. I was hoping for something that would be framework agnostic, but this will do for now. Thanks all for your help and suggestions. Mitch --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org