• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB3 init load my own properties

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I'm using EJB3 and I'd like to load my own properies from an xml during the init time.
Searching around I found this code

is this the best way to load my properties in a steless bean?
Thanks in advance
[ March 14, 2007: Message edited by: Alessandro Ilardo ]
 
Debu Panda
author
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Init is typically used for EJB 3 bean with an adapted home or local home to maintain backward compatibility with EJB 2 clients. It can be used on a method and will have behavior similar to that of
the create<METHOD> method of an EJB 2 session bean.

You can load an XML or property file in the method annotated with @PostConstruct
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!