Re: Check if a URL exists programatically

2015-07-21 Thread Mitch Claborn
2015-07-17 18:48 GMT+03:00 Mitch Claborn : 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(r

Re: Check if a URL exists programatically

2015-07-21 Thread Konstantin Kolinko
2015-07-17 18:48 GMT+03:00 Mitch Claborn : > > 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 i

Re: Check if a URL exists programatically

2015-07-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mitch, On 7/20/15 2:09 PM, Mitch Claborn wrote: > On 07/17/2015 10:48 AM, Mitch Claborn wrote: >> On 07/16/2015 02:19 PM, chris derham wrote: I already have a custom error page. When I detect that a URL returned by google would return a 4

Re: Check if a URL exists programatically

2015-07-20 Thread Mitch Claborn
On 07/17/2015 10:48 AM, Mitch Claborn wrote: On 07/16/2015 02:19 PM, chris derham wrote: I already have a custom error page. When I detect that a URL returned by google would return a 404, I exclude it from the search results so that the user never sees it. Mitch Mitch, Ok I see now what yo

Re: Check if a URL exists programatically

2015-07-17 Thread Mitch Claborn
On 07/16/2015 02:19 PM, chris derham wrote: I already have a custom error page. When I detect that a URL returned by google would return a 404, I exclude it from the search results so that the user never sees it. Mitch Mitch, Ok I see now what you mean. Sorry your original email was quite cle

Re: Check if a URL exists programatically

2015-07-16 Thread chris derham
> I already have a custom error page. When I detect that a URL returned by > google would return a 404, I exclude it from the search results so that the > user never sees it. > > Mitch Mitch, Ok I see now what you mean. Sorry your original email was quite clear. Hmm interesting challenge. Big p

Re: Check if a URL exists programatically

2015-07-16 Thread Mitch Claborn
On 07/16/2015 01:04 PM, chris derham wrote: 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 sear

Re: Check if a URL exists programatically

2015-07-16 Thread chris derham
> 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 >

Check if a URL exists programatically

2015-07-16 Thread Mitch Claborn
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 f