You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Aaron Bartell <aa...@gmail.com> on 2005/02/22 03:13:46 UTC

Initialize bean for auto-login

Hi all,

I am trying to initialize a backing bean property using the param 
feature.  Here is my faces config entry:

    <managed-bean>
        <managed-bean-name>LoginCtl</managed-bean-name>
        
<managed-bean-class>com.mowyourlawn.controller.LoginController</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
         <managed-property>
            <property-name>user.name</property-name>
            <property-class>java.lang.String</property-class>
            <value>#{param.profile}</value>
        </managed-property>       
         <managed-property>
            <property-name>user.password</property-name>
            <property-class>java.lang.String</property-class>
            <value>#{param.password}</value>
        </managed-property>           
    </managed-bean>

I am implementing an auto login feature where a site not under my 
control can pass in a user and password on the query string and then I 
will auto execute the page and validate the information passed to me. I 
was trying to find the rules for what you can specify in the 
property-name tag but have come up empty handed.  It seems that it 
doesn't like anything that is a custom object (eg user.password where 
user is a User.java object and password is a String object)

Thoughts on how to make this work?

Thanks,
Aaron Bartell

Re: Initialize bean for auto-login

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Michal,

I just read that a new release of JSF-Spring is
available (compatibility with Spring 1.1.2 - 1.1.4).

http://theserverside.com/news/thread.tss?thread_id=32007


Regards,
Matthias

Michal Malecki wrote:
> Hi,
> JSF-Spring would solve your problem (although I know that it's not a small
> tool and using it only for one case is pointless). Unfortunatelly it's now
> supporting only spring 1.1.2.
> Michal Malecki
> 
>>Hi all,
>>
>>I am trying to initialize a backing bean property using the param
>>feature.  Here is my faces config entry:
>>
>>    <managed-bean>
>>        <managed-bean-name>LoginCtl</managed-bean-name>
>>
>>
> <managed-bean-class>com.mowyourlawn.controller.LoginController</managed-bean
> -class>
> 
>>        <managed-bean-scope>session</managed-bean-scope>
>>         <managed-property>
>>            <property-name>user.name</property-name>
>>            <property-class>java.lang.String</property-class>
>>            <value>#{param.profile}</value>
>>        </managed-property>
>>         <managed-property>
>>            <property-name>user.password</property-name>
>>            <property-class>java.lang.String</property-class>
>>            <value>#{param.password}</value>
>>        </managed-property>
>>    </managed-bean>
>>
>>I am implementing an auto login feature where a site not under my
>>control can pass in a user and password on the query string and then I
>>will auto execute the page and validate the information passed to me. I
>>was trying to find the rules for what you can specify in the
>>property-name tag but have come up empty handed.  It seems that it
>>doesn't like anything that is a custom object (eg user.password where
>>user is a User.java object and password is a String object)
>>
>>Thoughts on how to make this work?
>>
>>Thanks,
>>Aaron Bartell
>>
> 
> 
> 
> 

-- 
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
phone: +49-2572-9170275
cell phone: +49-179-1118979
email: matzew AT apache DOT org
url: http://www.wessendorf.net
callto://mwessendorf (Skype)
icq: 47016183

Re: Initialize bean for auto-login

Posted by Michal Malecki <mi...@poczta.onet.pl>.
Hi,
JSF-Spring would solve your problem (although I know that it's not a small
tool and using it only for one case is pointless). Unfortunatelly it's now
supporting only spring 1.1.2.
Michal Malecki
> Hi all,
>
> I am trying to initialize a backing bean property using the param
> feature.  Here is my faces config entry:
>
>     <managed-bean>
>         <managed-bean-name>LoginCtl</managed-bean-name>
>
>
<managed-bean-class>com.mowyourlawn.controller.LoginController</managed-bean
-class>
>         <managed-bean-scope>session</managed-bean-scope>
>          <managed-property>
>             <property-name>user.name</property-name>
>             <property-class>java.lang.String</property-class>
>             <value>#{param.profile}</value>
>         </managed-property>
>          <managed-property>
>             <property-name>user.password</property-name>
>             <property-class>java.lang.String</property-class>
>             <value>#{param.password}</value>
>         </managed-property>
>     </managed-bean>
>
> I am implementing an auto login feature where a site not under my
> control can pass in a user and password on the query string and then I
> will auto execute the page and validate the information passed to me. I
> was trying to find the rules for what you can specify in the
> property-name tag but have come up empty handed.  It seems that it
> doesn't like anything that is a custom object (eg user.password where
> user is a User.java object and password is a String object)
>
> Thoughts on how to make this work?
>
> Thanks,
> Aaron Bartell
>



Re: Initialize bean for auto-login

Posted by Heath Borders <he...@gmail.com>.
I'm not sure that you can get something like this to go, but its
definitely a case we should consider supporting.

In the meantime, why not just provide a custom-setter for the
user.name and user.password  fields on your LoginController?


On Mon, 21 Feb 2005 20:13:46 -0600, Aaron Bartell
<aa...@gmail.com> wrote:
> Hi all,
> 
> I am trying to initialize a backing bean property using the param
> feature.  Here is my faces config entry:
> 
>     <managed-bean>
>         <managed-bean-name>LoginCtl</managed-bean-name>
> 
> <managed-bean-class>com.mowyourlawn.controller.LoginController</managed-bean-class>
>         <managed-bean-scope>session</managed-bean-scope>
>          <managed-property>
>             <property-name>user.name</property-name>
>             <property-class>java.lang.String</property-class>
>             <value>#{param.profile}</value>
>         </managed-property>
>          <managed-property>
>             <property-name>user.password</property-name>
>             <property-class>java.lang.String</property-class>
>             <value>#{param.password}</value>
>         </managed-property>
>     </managed-bean>
> 
> I am implementing an auto login feature where a site not under my
> control can pass in a user and password on the query string and then I
> will auto execute the page and validate the information passed to me. I
> was trying to find the rules for what you can specify in the
> property-name tag but have come up empty handed.  It seems that it
> doesn't like anything that is a custom object (eg user.password where
> user is a User.java object and password is a String object)
> 
> Thoughts on how to make this work?
> 
> Thanks,
> Aaron Bartell
> 


-- 
-Heath Borders-Wing
hborders@mail.win.org