Short question: How can I, from within code running under Tomcat, determine if a given URL request to that tomcat instance would result in a 404 or not, without calling back to the Tomcat using an HTTP HEAD or GET?

Background: We use google custom search by calling the google server and then formatting the results on our search page. Our range of products is fairly fluid, and there is occasionally a gap between when a product goes away and the google search index is updated, which would result in a 404 if user clicked that link in the search results. (I know that I can ask google to re-index, but I still need to solve this problem.)

Rather than write a ton of code for the various types of pages that we have (product, category, etc) I'd like to just be able to call some Tomcat method to determine if the URL that I get back from google would result in a 404 or not. I'm currently calling back to the Tomcat instance using an HTTP HEAD call, but that is a waste of resources and during periods of high volume uses up processing threads that I want to reserve for actual customers.

We are using Tomcat 7 with Struts.


--

Mitch


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to