You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by mraible <ma...@raibledesigns.com> on 2007/08/27 19:31:00 UTC
@PostConstruct - managed properties not set first
I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by Jacob
Hookom:
http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
I added the javax.annotation dependency to my pom.xml:
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
My managed bean looks as follows:
<managed-bean>
<managed-bean-name>userForm</managed-bean-name>
<managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>userManager</property-name>
<value>#{userManager}</value>
</managed-property>
</managed-bean>
If I fire up a debugger, my @PostConstruct method gets hit, but none of my
managed properties have been initialized. Even if I pass in ?id=12.
I'm using the latest release of the maven-jetty-plugin (6.1H.5-beta).
Any ideas?
Thanks,
Matt
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a12353855
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by kace <me...@hotmail.com>.
Cheers Matt
mraible wrote:
>
> Download from
> http://static.raibledesigns.com/downloads/jsf-postconstruct.zip
>
> To use, install MySQL and Maven 2.
>
> Set src/main/resources/jdbc.properties to match your MySQL instance.
> Start with "mvn jetty:run" in the jsf-postconstruct directory.
>
> I tried putting the contents of edit() into void init() and it didn't work
> - nor did it work when the method body was in edit(). The tests don't
> pass, so you might need to use -Dmaven.test.skip=true.
>
> Matt
>
>
> kace wrote:
>>
>> That would be fantastic. Thankyou
>>
>> ..kace
>>
>> mraible wrote:
>>>
>>> I can probably whip up an example with AppFuse Light if that works.
>>>
>>> Matt
>>>
>>>
>>> kace wrote:
>>>>
>>>> Hey Matt, are you in a position to provide a working example for how
>>>> you got it to work on Glassfish so i can mess around with it on
>>>> tomcat/jetty with appfuse in mind?
>>>>
>>>> Appreciate any help on this.
>>>> Thanks.
>>>>
>>>> ..kace
>>>>
>>>> mraible wrote:
>>>>>
>>>>> I never got this to work on Tomcat or Jetty, I only got it to work on
>>>>> GlassFish. I suspect that changing web.xml to use a Servlet 2.5 XSD
>>>>> might fix the problem.
>>>>>
>>>>> Matt
>>>>>
>>>>>
>>>>> kace wrote:
>>>>>>
>>>>>> Hi Matt,
>>>>>>
>>>>>> did you get this to work for you? Im using appfuse 2 with myfaces
>>>>>> 1.20 implementation. Do I have to switch to Suns RI to use this?
>>>>>>
>>>>>> ..kace
>>>>>>
>>>>>> mraible wrote:
>>>>>>>
>>>>>>> Is there a working example that uses @PostConstruct I can look at?
>>>>>>> Google doesn't seem to help much on this one. A bunch of folks
>>>>>>> saying it works, but no proof. ;-)
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Matt
>>>>>>>
>>>>>>>
>>>>>>> mraible wrote:
>>>>>>>>
>>>>>>>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by
>>>>>>>> Jacob Hookom:
>>>>>>>>
>>>>>>>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>>>>>>>
>>>>>>>> I added the javax.annotation dependency to my pom.xml:
>>>>>>>>
>>>>>>>> <dependency>
>>>>>>>> <groupId>javax.annotation</groupId>
>>>>>>>> <artifactId>jsr250-api</artifactId>
>>>>>>>> <version>1.0</version>
>>>>>>>> </dependency>
>>>>>>>>
>>>>>>>> My managed bean looks as follows:
>>>>>>>>
>>>>>>>> <managed-bean>
>>>>>>>> <managed-bean-name>userForm</managed-bean-name>
>>>>>>>>
>>>>>>>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>>>>>>>> <managed-bean-scope>request</managed-bean-scope>
>>>>>>>> <managed-property>
>>>>>>>> <property-name>id</property-name>
>>>>>>>> <value>#{param.id}</value>
>>>>>>>> </managed-property>
>>>>>>>> <managed-property>
>>>>>>>> <property-name>userManager</property-name>
>>>>>>>> <value>#{userManager}</value>
>>>>>>>> </managed-property>
>>>>>>>> </managed-bean>
>>>>>>>>
>>>>>>>> If I fire up a debugger, my @PostConstruct method gets hit, but
>>>>>>>> none of my managed properties have been initialized. Even if I pass
>>>>>>>> in ?id=12.
>>>>>>>>
>>>>>>>> I'm using the latest release of the maven-jetty-plugin
>>>>>>>> (6.1H.5-beta).
>>>>>>>>
>>>>>>>> Any ideas?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Matt
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13384958
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by kace <me...@hotmail.com>.
Cheeers Mate.
mraible wrote:
>
> Download from
> http://static.raibledesigns.com/downloads/jsf-postconstruct.zip
>
> To use, install MySQL and Maven 2.
>
> Set src/main/resources/jdbc.properties to match your MySQL instance.
> Start with "mvn jetty:run" in the jsf-postconstruct directory.
>
> I tried putting the contents of edit() into void init() and it didn't work
> - nor did it work when the method body was in edit(). The tests don't
> pass, so you might need to use -Dmaven.test.skip=true.
>
> Matt
>
>
> kace wrote:
>>
>> That would be fantastic. Thankyou
>>
>> ..kace
>>
>> mraible wrote:
>>>
>>> I can probably whip up an example with AppFuse Light if that works.
>>>
>>> Matt
>>>
>>>
>>> kace wrote:
>>>>
>>>> Hey Matt, are you in a position to provide a working example for how
>>>> you got it to work on Glassfish so i can mess around with it on
>>>> tomcat/jetty with appfuse in mind?
>>>>
>>>> Appreciate any help on this.
>>>> Thanks.
>>>>
>>>> ..kace
>>>>
>>>> mraible wrote:
>>>>>
>>>>> I never got this to work on Tomcat or Jetty, I only got it to work on
>>>>> GlassFish. I suspect that changing web.xml to use a Servlet 2.5 XSD
>>>>> might fix the problem.
>>>>>
>>>>> Matt
>>>>>
>>>>>
>>>>> kace wrote:
>>>>>>
>>>>>> Hi Matt,
>>>>>>
>>>>>> did you get this to work for you? Im using appfuse 2 with myfaces
>>>>>> 1.20 implementation. Do I have to switch to Suns RI to use this?
>>>>>>
>>>>>> ..kace
>>>>>>
>>>>>> mraible wrote:
>>>>>>>
>>>>>>> Is there a working example that uses @PostConstruct I can look at?
>>>>>>> Google doesn't seem to help much on this one. A bunch of folks
>>>>>>> saying it works, but no proof. ;-)
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Matt
>>>>>>>
>>>>>>>
>>>>>>> mraible wrote:
>>>>>>>>
>>>>>>>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by
>>>>>>>> Jacob Hookom:
>>>>>>>>
>>>>>>>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>>>>>>>
>>>>>>>> I added the javax.annotation dependency to my pom.xml:
>>>>>>>>
>>>>>>>> <dependency>
>>>>>>>> <groupId>javax.annotation</groupId>
>>>>>>>> <artifactId>jsr250-api</artifactId>
>>>>>>>> <version>1.0</version>
>>>>>>>> </dependency>
>>>>>>>>
>>>>>>>> My managed bean looks as follows:
>>>>>>>>
>>>>>>>> <managed-bean>
>>>>>>>> <managed-bean-name>userForm</managed-bean-name>
>>>>>>>>
>>>>>>>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>>>>>>>> <managed-bean-scope>request</managed-bean-scope>
>>>>>>>> <managed-property>
>>>>>>>> <property-name>id</property-name>
>>>>>>>> <value>#{param.id}</value>
>>>>>>>> </managed-property>
>>>>>>>> <managed-property>
>>>>>>>> <property-name>userManager</property-name>
>>>>>>>> <value>#{userManager}</value>
>>>>>>>> </managed-property>
>>>>>>>> </managed-bean>
>>>>>>>>
>>>>>>>> If I fire up a debugger, my @PostConstruct method gets hit, but
>>>>>>>> none of my managed properties have been initialized. Even if I pass
>>>>>>>> in ?id=12.
>>>>>>>>
>>>>>>>> I'm using the latest release of the maven-jetty-plugin
>>>>>>>> (6.1H.5-beta).
>>>>>>>>
>>>>>>>> Any ideas?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Matt
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13384520
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by mraible <ma...@raibledesigns.com>.
Download from http://static.raibledesigns.com/downloads/jsf-postconstruct.zip
To use, install MySQL and Maven 2.
Set src/main/resources/jdbc.properties to match your MySQL instance.
Start with "mvn jetty:run" in the jsf-postconstruct directory.
I tried putting the contents of edit() into void init() and it didn't work -
nor did it work when the method body was in edit(). The tests don't pass, so
you might need to use -Dmaven.test.skip=true.
Matt
kace wrote:
>
> That would be fantastic. Thankyou
>
> ..kace
>
> mraible wrote:
>>
>> I can probably whip up an example with AppFuse Light if that works.
>>
>> Matt
>>
>>
>> kace wrote:
>>>
>>> Hey Matt, are you in a position to provide a working example for how you
>>> got it to work on Glassfish so i can mess around with it on tomcat/jetty
>>> with appfuse in mind?
>>>
>>> Appreciate any help on this.
>>> Thanks.
>>>
>>> ..kace
>>>
>>> mraible wrote:
>>>>
>>>> I never got this to work on Tomcat or Jetty, I only got it to work on
>>>> GlassFish. I suspect that changing web.xml to use a Servlet 2.5 XSD
>>>> might fix the problem.
>>>>
>>>> Matt
>>>>
>>>>
>>>> kace wrote:
>>>>>
>>>>> Hi Matt,
>>>>>
>>>>> did you get this to work for you? Im using appfuse 2 with myfaces 1.20
>>>>> implementation. Do I have to switch to Suns RI to use this?
>>>>>
>>>>> ..kace
>>>>>
>>>>> mraible wrote:
>>>>>>
>>>>>> Is there a working example that uses @PostConstruct I can look at?
>>>>>> Google doesn't seem to help much on this one. A bunch of folks saying
>>>>>> it works, but no proof. ;-)
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Matt
>>>>>>
>>>>>>
>>>>>> mraible wrote:
>>>>>>>
>>>>>>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by
>>>>>>> Jacob Hookom:
>>>>>>>
>>>>>>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>>>>>>
>>>>>>> I added the javax.annotation dependency to my pom.xml:
>>>>>>>
>>>>>>> <dependency>
>>>>>>> <groupId>javax.annotation</groupId>
>>>>>>> <artifactId>jsr250-api</artifactId>
>>>>>>> <version>1.0</version>
>>>>>>> </dependency>
>>>>>>>
>>>>>>> My managed bean looks as follows:
>>>>>>>
>>>>>>> <managed-bean>
>>>>>>> <managed-bean-name>userForm</managed-bean-name>
>>>>>>>
>>>>>>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>>>>>>> <managed-bean-scope>request</managed-bean-scope>
>>>>>>> <managed-property>
>>>>>>> <property-name>id</property-name>
>>>>>>> <value>#{param.id}</value>
>>>>>>> </managed-property>
>>>>>>> <managed-property>
>>>>>>> <property-name>userManager</property-name>
>>>>>>> <value>#{userManager}</value>
>>>>>>> </managed-property>
>>>>>>> </managed-bean>
>>>>>>>
>>>>>>> If I fire up a debugger, my @PostConstruct method gets hit, but none
>>>>>>> of my managed properties have been initialized. Even if I pass in
>>>>>>> ?id=12.
>>>>>>>
>>>>>>> I'm using the latest release of the maven-jetty-plugin
>>>>>>> (6.1H.5-beta).
>>>>>>>
>>>>>>> Any ideas?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Matt
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13379031
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by kace <me...@hotmail.com>.
That would be fantastic. Thankyou
..kace
mraible wrote:
>
> I can probably whip up an example with AppFuse Light if that works.
>
> Matt
>
>
> kace wrote:
>>
>> Hey Matt, are you in a position to provide a working example for how you
>> got it to work on Glassfish so i can mess around with it on tomcat/jetty
>> with appfuse in mind?
>>
>> Appreciate any help on this.
>> Thanks.
>>
>> ..kace
>>
>> mraible wrote:
>>>
>>> I never got this to work on Tomcat or Jetty, I only got it to work on
>>> GlassFish. I suspect that changing web.xml to use a Servlet 2.5 XSD
>>> might fix the problem.
>>>
>>> Matt
>>>
>>>
>>> kace wrote:
>>>>
>>>> Hi Matt,
>>>>
>>>> did you get this to work for you? Im using appfuse 2 with myfaces 1.20
>>>> implementation. Do I have to switch to Suns RI to use this?
>>>>
>>>> ..kace
>>>>
>>>> mraible wrote:
>>>>>
>>>>> Is there a working example that uses @PostConstruct I can look at?
>>>>> Google doesn't seem to help much on this one. A bunch of folks saying
>>>>> it works, but no proof. ;-)
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Matt
>>>>>
>>>>>
>>>>> mraible wrote:
>>>>>>
>>>>>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by
>>>>>> Jacob Hookom:
>>>>>>
>>>>>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>>>>>
>>>>>> I added the javax.annotation dependency to my pom.xml:
>>>>>>
>>>>>> <dependency>
>>>>>> <groupId>javax.annotation</groupId>
>>>>>> <artifactId>jsr250-api</artifactId>
>>>>>> <version>1.0</version>
>>>>>> </dependency>
>>>>>>
>>>>>> My managed bean looks as follows:
>>>>>>
>>>>>> <managed-bean>
>>>>>> <managed-bean-name>userForm</managed-bean-name>
>>>>>>
>>>>>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>>>>>> <managed-bean-scope>request</managed-bean-scope>
>>>>>> <managed-property>
>>>>>> <property-name>id</property-name>
>>>>>> <value>#{param.id}</value>
>>>>>> </managed-property>
>>>>>> <managed-property>
>>>>>> <property-name>userManager</property-name>
>>>>>> <value>#{userManager}</value>
>>>>>> </managed-property>
>>>>>> </managed-bean>
>>>>>>
>>>>>> If I fire up a debugger, my @PostConstruct method gets hit, but none
>>>>>> of my managed properties have been initialized. Even if I pass in
>>>>>> ?id=12.
>>>>>>
>>>>>> I'm using the latest release of the maven-jetty-plugin (6.1H.5-beta).
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Matt
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13353354
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by mraible <ma...@raibledesigns.com>.
I can probably whip up an example with AppFuse Light if that works.
Matt
kace wrote:
>
> Hey Matt, are you in a position to provide a working example for how you
> got it to work on Glassfish so i can mess around with it on tomcat/jetty
> with appfuse in mind?
>
> Appreciate any help on this.
> Thanks.
>
> ..kace
>
> mraible wrote:
>>
>> I never got this to work on Tomcat or Jetty, I only got it to work on
>> GlassFish. I suspect that changing web.xml to use a Servlet 2.5 XSD might
>> fix the problem.
>>
>> Matt
>>
>>
>> kace wrote:
>>>
>>> Hi Matt,
>>>
>>> did you get this to work for you? Im using appfuse 2 with myfaces 1.20
>>> implementation. Do I have to switch to Suns RI to use this?
>>>
>>> ..kace
>>>
>>> mraible wrote:
>>>>
>>>> Is there a working example that uses @PostConstruct I can look at?
>>>> Google doesn't seem to help much on this one. A bunch of folks saying
>>>> it works, but no proof. ;-)
>>>>
>>>> Thanks,
>>>>
>>>> Matt
>>>>
>>>>
>>>> mraible wrote:
>>>>>
>>>>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by
>>>>> Jacob Hookom:
>>>>>
>>>>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>>>>
>>>>> I added the javax.annotation dependency to my pom.xml:
>>>>>
>>>>> <dependency>
>>>>> <groupId>javax.annotation</groupId>
>>>>> <artifactId>jsr250-api</artifactId>
>>>>> <version>1.0</version>
>>>>> </dependency>
>>>>>
>>>>> My managed bean looks as follows:
>>>>>
>>>>> <managed-bean>
>>>>> <managed-bean-name>userForm</managed-bean-name>
>>>>>
>>>>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>>>>> <managed-bean-scope>request</managed-bean-scope>
>>>>> <managed-property>
>>>>> <property-name>id</property-name>
>>>>> <value>#{param.id}</value>
>>>>> </managed-property>
>>>>> <managed-property>
>>>>> <property-name>userManager</property-name>
>>>>> <value>#{userManager}</value>
>>>>> </managed-property>
>>>>> </managed-bean>
>>>>>
>>>>> If I fire up a debugger, my @PostConstruct method gets hit, but none
>>>>> of my managed properties have been initialized. Even if I pass in
>>>>> ?id=12.
>>>>>
>>>>> I'm using the latest release of the maven-jetty-plugin (6.1H.5-beta).
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Matt
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13353353
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by kace <me...@hotmail.com>.
Hey Matt, are you in a position to provide a working example for how you got
it to work on Glassfish so i can mess around with it on tomcat/jetty with
appfuse in mind?
Appreciate any help on this.
Thanks.
..kace
mraible wrote:
>
> I never got this to work on Tomcat or Jetty, I only got it to work on
> GlassFish. I suspect that changing web.xml to use a Servlet 2.5 XSD might
> fix the problem.
>
> Matt
>
>
> kace wrote:
>>
>> Hi Matt,
>>
>> did you get this to work for you? Im using appfuse 2 with myfaces 1.20
>> implementation. Do I have to switch to Suns RI to use this?
>>
>> ..kace
>>
>> mraible wrote:
>>>
>>> Is there a working example that uses @PostConstruct I can look at?
>>> Google doesn't seem to help much on this one. A bunch of folks saying it
>>> works, but no proof. ;-)
>>>
>>> Thanks,
>>>
>>> Matt
>>>
>>>
>>> mraible wrote:
>>>>
>>>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by
>>>> Jacob Hookom:
>>>>
>>>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>>>
>>>> I added the javax.annotation dependency to my pom.xml:
>>>>
>>>> <dependency>
>>>> <groupId>javax.annotation</groupId>
>>>> <artifactId>jsr250-api</artifactId>
>>>> <version>1.0</version>
>>>> </dependency>
>>>>
>>>> My managed bean looks as follows:
>>>>
>>>> <managed-bean>
>>>> <managed-bean-name>userForm</managed-bean-name>
>>>>
>>>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>>>> <managed-bean-scope>request</managed-bean-scope>
>>>> <managed-property>
>>>> <property-name>id</property-name>
>>>> <value>#{param.id}</value>
>>>> </managed-property>
>>>> <managed-property>
>>>> <property-name>userManager</property-name>
>>>> <value>#{userManager}</value>
>>>> </managed-property>
>>>> </managed-bean>
>>>>
>>>> If I fire up a debugger, my @PostConstruct method gets hit, but none of
>>>> my managed properties have been initialized. Even if I pass in ?id=12.
>>>>
>>>> I'm using the latest release of the maven-jetty-plugin (6.1H.5-beta).
>>>>
>>>> Any ideas?
>>>>
>>>> Thanks,
>>>>
>>>> Matt
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13353232
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by mraible <ma...@raibledesigns.com>.
I never got this to work on Tomcat or Jetty, I only got it to work on
GlassFish. I suspect that changing web.xml to use a Servlet 2.5 XSD might
fix the problem.
Matt
kace wrote:
>
> Hi Matt,
>
> did you get this to work for you? Im using appfuse 2 with myfaces 1.20
> implementation. Do I have to switch to Suns RI to use this?
>
> ..kace
>
> mraible wrote:
>>
>> Is there a working example that uses @PostConstruct I can look at? Google
>> doesn't seem to help much on this one. A bunch of folks saying it works,
>> but no proof. ;-)
>>
>> Thanks,
>>
>> Matt
>>
>>
>> mraible wrote:
>>>
>>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by
>>> Jacob Hookom:
>>>
>>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>>
>>> I added the javax.annotation dependency to my pom.xml:
>>>
>>> <dependency>
>>> <groupId>javax.annotation</groupId>
>>> <artifactId>jsr250-api</artifactId>
>>> <version>1.0</version>
>>> </dependency>
>>>
>>> My managed bean looks as follows:
>>>
>>> <managed-bean>
>>> <managed-bean-name>userForm</managed-bean-name>
>>>
>>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>>> <managed-bean-scope>request</managed-bean-scope>
>>> <managed-property>
>>> <property-name>id</property-name>
>>> <value>#{param.id}</value>
>>> </managed-property>
>>> <managed-property>
>>> <property-name>userManager</property-name>
>>> <value>#{userManager}</value>
>>> </managed-property>
>>> </managed-bean>
>>>
>>> If I fire up a debugger, my @PostConstruct method gets hit, but none of
>>> my managed properties have been initialized. Even if I pass in ?id=12.
>>>
>>> I'm using the latest release of the maven-jetty-plugin (6.1H.5-beta).
>>>
>>> Any ideas?
>>>
>>> Thanks,
>>>
>>> Matt
>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13330444
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by kace <me...@hotmail.com>.
Hi Matt,
did you get this to work for you? Im using appfuse 2 with myfaces 1.20
implementation. Do I have to switch to Suns RI to use this?
..kace
mraible wrote:
>
> Is there a working example that uses @PostConstruct I can look at? Google
> doesn't seem to help much on this one. A bunch of folks saying it works,
> but no proof. ;-)
>
> Thanks,
>
> Matt
>
>
> mraible wrote:
>>
>> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by Jacob
>> Hookom:
>>
>> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>>
>> I added the javax.annotation dependency to my pom.xml:
>>
>> <dependency>
>> <groupId>javax.annotation</groupId>
>> <artifactId>jsr250-api</artifactId>
>> <version>1.0</version>
>> </dependency>
>>
>> My managed bean looks as follows:
>>
>> <managed-bean>
>> <managed-bean-name>userForm</managed-bean-name>
>> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
>> <managed-bean-scope>request</managed-bean-scope>
>> <managed-property>
>> <property-name>id</property-name>
>> <value>#{param.id}</value>
>> </managed-property>
>> <managed-property>
>> <property-name>userManager</property-name>
>> <value>#{userManager}</value>
>> </managed-property>
>> </managed-bean>
>>
>> If I fire up a debugger, my @PostConstruct method gets hit, but none of
>> my managed properties have been initialized. Even if I pass in ?id=12.
>>
>> I'm using the latest release of the maven-jetty-plugin (6.1H.5-beta).
>>
>> Any ideas?
>>
>> Thanks,
>>
>> Matt
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a13328973
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: @PostConstruct - managed properties not set first
Posted by mraible <ma...@raibledesigns.com>.
Is there a working example that uses @PostConstruct I can look at? Google
doesn't seem to help much on this one. A bunch of folks saying it works, but
no proof. ;-)
Thanks,
Matt
mraible wrote:
>
> I'm trying to use @PostConstruct with MyFaces 1.2.0 as described by Jacob
> Hookom:
>
> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
>
> I added the javax.annotation dependency to my pom.xml:
>
> <dependency>
> <groupId>javax.annotation</groupId>
> <artifactId>jsr250-api</artifactId>
> <version>1.0</version>
> </dependency>
>
> My managed bean looks as follows:
>
> <managed-bean>
> <managed-bean-name>userForm</managed-bean-name>
> <managed-bean-class>org.appfuse.web.UserForm</managed-bean-class>
> <managed-bean-scope>request</managed-bean-scope>
> <managed-property>
> <property-name>id</property-name>
> <value>#{param.id}</value>
> </managed-property>
> <managed-property>
> <property-name>userManager</property-name>
> <value>#{userManager}</value>
> </managed-property>
> </managed-bean>
>
> If I fire up a debugger, my @PostConstruct method gets hit, but none of my
> managed properties have been initialized. Even if I pass in ?id=12.
>
> I'm using the latest release of the maven-jetty-plugin (6.1H.5-beta).
>
> Any ideas?
>
> Thanks,
>
> Matt
>
>
>
--
View this message in context: http://www.nabble.com/%40PostConstruct---managed-properties-not-set-first-tf4337121.html#a12359140
Sent from the MyFaces - Users mailing list archive at Nabble.com.