This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling doGet() method from init() method

 
Sreenivasa Rao Pitchuka
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my application, I need to start a Servlet at server startup.For that I'm using a load-on-startup param.From this (i.e from init())I need to execute another task through doGet() method. Is it possible.
Please inform ASAP.
Thanks and regards,
Sreenivas
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot call doGet from init because you do not have request and response object to pass one, unless you create an instance of those yourselves.
Why dont you call the task method directly.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way you do this is to make the task separate from both the init() and doGet() methods, and you can then call it from either one.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic