Java SE has clearly defined entry point of the program execution - 'public static void main(String[] args)' method. However, when it comes to Java EE such an entry point is blurred. Can we create main method in Java EE?
import javax.annotation.PostConstruct; import javax.ejb.Singleton; import javax.ejb.Startup; @Singleton @Startup public class MainMethodBean { @PostConstruct public void main() { System.out.println("Hello world from java EE!"); } }
We have just created our Java EE (EJB3.1) 'Hello world' application! Now you can configure your environment and deploy your EJB.
You did't reduced complexity of issues discussed on your blog, did You? ;)
ReplyDeleteIt was off the top of my head :).
Delete