• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ping URL from a Servlet

 
Michael Johnson, CO
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I apologize if this is an elementary question, but I can't seem to find an exact answer from Google or while cruising these forums.

I am expiring and refreshing a cache of documents from a servlet. The only way to refresh the cache is by hitting a URL which causes a page to load, thereby refreshing the cache. I really don't care about the response, I only want to "ping" the page so that it will trigger its action and load itself into the cache. My question is this: How do I create a call from a servlet to "ping", "touch", "trigger" a jsp page? Thank you in advance for your help!

Michael J
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a HEAD request (instead of GET or POST), assuming that it is not done using the browser, but by some piece of Java code. HEAD requests are answered just by sending the response header, while the body is omitted; otherwise it's similar to GET. Or you can add a parameter to a GET request that indicates that an empty body can be sent in the response.
 
Michael Johnson, CO
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that sounds like what I'm looking for. I've never had to write a servlet before, although, this one does not appear to be too complicated, but just that little bit of info will give me what I need to google the rest. Thank you for your help!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!