File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Startup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Startup" Watch "Startup" New topic
Author

Startup

Anila Mathew
Ranch Hand

Joined: Jun 16, 2004
Posts: 69

Hi,

I need a startup class for weblogic which instantiates some classes.Is it mandatory that startup should always have the public static void main() method?

Thanks,
Anila
Anila Mathew
Ranch Hand

Joined: Jun 16, 2004
Posts: 69

Does anyone had a chance to look at my question??
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

I need a startup class for weblogic which instantiates some classes.Is it mandatory that startup should always have the public static void main() method?


Write a class called StartupServlet which extends GenricServlet.
In the init method instanciate all the class which you want to load.

In the web.xml use following tag.
<servlet>
<servlet-name>Startup Servlet</servlet-name>
<servlet-class>StartupServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
Rejeev Divakaran
Greenhorn

Joined: Aug 12, 2007
Posts: 27
As I understand it needs to have public main() method. Not necesary to be static or void.


Regards,<br />Rejeev<br />Blog: <a href="http://rejeev.blogspot.com/" target="_blank" rel="nofollow">http://rejeev.blogspot.com/</a>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Startup
 
Similar Threads
Recommendations for Webhosting for Struts2 (GoDaddy issue)
WA #1.....word association
What does load-on-startup?
Exception in Struts namespace
Replacement for the T3StartupDef Class