开发者

What is the proper way of init of application ear under jboss

i need right at the start of my ear that some code was execut开发者_开发知识库ed to init application before it is used. So i wonder what is the proper way of doing this, possibly via some jboss configs, or via spring?

I' using spring3 and jboss4


If you're using Spring, use a Spring way, then you won't be tied to JBoss if you ever move off it. Here are some options:

  • Implement InitializingBean; example
  • Run code inside of a bean's controller
  • Annotate a method in a bean with @PostConstruct; example

Any of these methods work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜