• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

@PostConstruct dont work

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any ideas?
 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic