• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@PostConstruct dont work

 
javier pavon
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The construct for my backing bean it is called twice, so i need a method what will be call only once for init the bean parameters (database, webservices...), do this twice is very slow.

On internet i have said the annotation @postconstruct, but it is not working for me.

In my bean i have the constructor and the init method




I am using jsf 1.2, this is my header faces-config



and in the web.xml




I dont know why in the init method annotated with @postConstruct it is not ever call.
 
javier pavon
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any ideas?
 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious if you discovered the reason behind it being called twice?

 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like something to do with what librarys you are running with.

I actually have two different scenarios with the same project, netbeans runs my project fine with beans only being created once, whereas intellij is having the problem you mention and calling the method twice.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic