Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cron for JSP ?  RSS feed

 
Dylan Stamatopolis
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP page which does a bunch of DB updates, and I tried setting up a Crontab to access this page on a daily basis, so the DB gets updated daily.

I receive a bunch of errors... and I'm assuming that I'm not able to run a Crontab on a JSP file, but only a Servlet (as there is no HTTP session for the JSP)
Is this assumption correct ?

If so, what are the alternatives. I could assume that I could either:
1) Do a WGET in my cron to access the JSP page.
2) Implement the DB update in a Servlet.

Any ideas / input would be greatly appreciated
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First thing to say is a JSP and a Servlet are identical.
2nd thing is how are you calling the JSP ? With "java yourJSP" ??
This won't work, cause a JSP has no main method.

I would do a WGET on the JSP then it should work.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!