users@glassfish.java.net

RE: Cannot get _at_ManagedProperty to work

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Sun, 19 Sep 2010 19:16:05 -0400

implement javax.annotation.ManagedBean on the class to be Managed for example by annotation
 
@ManagedBean
public class GoHere {
http://www.mkyong.com/jsf2/configure-managed-beans-in-jsf-2-0/

any reason you're implementing RequestScope instead of SessionScope ?
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Sun, 19 Sep 2010 13:08:47 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: Cannot get @ManagedProperty to work
>
> This is really bugging me. I can get managed properties to work with tags in faces-config.xml but I am trying to use @javax.faces.bean.ManagedProperty instead. Below is my whole source code, and the bean gets instantiated but the setters for param1 and param2 never get called. Am I doing something wrong?
>
> [code]
> package test10;
>
> import javax.faces.bean.ManagedProperty;
> import javax.faces.bean.RequestScoped;
> import javax.inject.Named;
>
> /**
> *
> * @author alandeikman
> */
>
> @Named (value="goHere")
> @RequestScoped
> public class GoHere {
>
> @ManagedProperty(value="DefaultValue")
> private String param1;
>
> @ManagedProperty(value="#{param['toot']}")
> private String param2;
>
> public GoHere() {
>
> }
>
> public String getParam1() {
> return param1;
> }
>
> public void setParam1(String param1) {
> this.param1 = param1;
> }
>
> public String getParam2() {
> return param2;
> }
>
> public void setParam2(String param2) {
> this.param2 = param2;
> }
>
> public String getParam3() { return "fixedValue"; }
>
> }
>
> [/code]
> [Message sent by forum member 'alan94539']
>
> http://forums.java.net/jive/thread.jspa?messageID=483098
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>