You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jesper Zedlitz <je...@zedlitz.de> on 2006/09/21 14:29:46 UTC

tapestry-acegi form based login

Is it possible to use a html form for login with tapestry-acegi instead of
HTTP basic authentication?

I would like to write a third part for my tutorial
http://wiki.apache.org/tapestry/AcegiSpringJava5 about that topic.

Jesper

-- 
 Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
                  Homepage : http://www.zedlitz.de
                  ICQ#     : 23890711


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: BeanForm and no setter method for persistence id

Posted by D&J Gredler <dj...@gmail.com>.
Cool, thanks for the update!

On 9/22/06, Claus Myglegaard Vagner <cv...@nordija.com> wrote:
>
> Hi Daniel,
>
> You are quite right! No problem with BeanForm component. The problem
> were somewhere else in the code...
>
> Claus
>
> D&J Gredler skrev:
> > Are you listing the properties explicitly, i.e.
> > properties="name,description"? If that's the case, I don't see how the
> > BeanForm knows anything at all about your ID field. And if there's not
> > even a setId( ) method, there's no way at all for BeanForm to modify
> > the property (it doesn't modify fields directly). Is your Group object
> > marked persistent in the page specification? This sounds like a
> > problem somewhere else...
> >
> > Keep me updated,
> >
> > Daniel
> >
> >
> > On 9/21/06, *Claus Myglegaard Vagner* <cvagner@nordija.com
> > <ma...@nordija.com>> wrote:
> >
> >     Hi,
> >
> >     Is it possible to use the BeanForm component
> >     ( http://beanform.sourceforge.net/) for updating a pojo with no
> setter
> >     method for a persistence id?
> >
> >     For example I have a Group object with properties id, name,
> >     description.
> >     In the form only name and description is shown. I don't want to
> >     show the
> >     id and I don't want to have a setId(id) method on the pojo. This
> >     should
> >     be controlled by hibernate (with field access) completely.
> >
> >     When there is no setter method for id - BeanForm is returning a
> Group
> >     object with a null "value" for id. This means that what should
> >     have been
> >     an update in the database becomes an insert since hibernate thinks
> >     that
> >     it is an not-persisted object (no id).
> >
> >     Why cant the BeanForm component just update the fields in action
> >     (in the
> >     form) for the pojo e.g . just call setName and setDecription and
> leave
> >     the id intact?
> >
> >     Regards Claus
> >
> >
> >
> ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >     <ma...@tapestry.apache.org>
> >     For additional commands, e-mail: users-help@tapestry.apache.org
> >     <ma...@tapestry.apache.org>
> >
> >
>
>

Re: BeanForm and no setter method for persistence id

Posted by Claus Myglegaard Vagner <cv...@nordija.com>.
Hi Daniel,

You are quite right! No problem with BeanForm component. The problem 
were somewhere else in the code...

Claus

D&J Gredler skrev:
> Are you listing the properties explicitly, i.e. 
> properties="name,description"? If that's the case, I don't see how the 
> BeanForm knows anything at all about your ID field. And if there's not 
> even a setId( ) method, there's no way at all for BeanForm to modify 
> the property (it doesn't modify fields directly). Is your Group object 
> marked persistent in the page specification? This sounds like a 
> problem somewhere else...
>
> Keep me updated,
>
> Daniel
>
>
> On 9/21/06, *Claus Myglegaard Vagner* <cvagner@nordija.com 
> <ma...@nordija.com>> wrote:
>
>     Hi,
>
>     Is it possible to use the BeanForm component
>     ( http://beanform.sourceforge.net/) for updating a pojo with no setter
>     method for a persistence id?
>
>     For example I have a Group object with properties id, name,
>     description.
>     In the form only name and description is shown. I don't want to
>     show the
>     id and I don't want to have a setId(id) method on the pojo. This
>     should
>     be controlled by hibernate (with field access) completely.
>
>     When there is no setter method for id - BeanForm is returning a Group
>     object with a null "value" for id. This means that what should
>     have been
>     an update in the database becomes an insert since hibernate thinks
>     that
>     it is an not-persisted object (no id).
>
>     Why cant the BeanForm component just update the fields in action
>     (in the
>     form) for the pojo e.g . just call setName and setDecription and leave
>     the id intact?
>
>     Regards Claus
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>     <ma...@tapestry.apache.org>
>     For additional commands, e-mail: users-help@tapestry.apache.org
>     <ma...@tapestry.apache.org>
>
>

Re: BeanForm and no setter method for persistence id

Posted by D&J Gredler <dj...@gmail.com>.
Are you listing the properties explicitly, i.e.
properties="name,description"? If that's the case, I don't see how the
BeanForm knows anything at all about your ID field. And if there's not even
a setId( ) method, there's no way at all for BeanForm to modify the property
(it doesn't modify fields directly). Is your Group object marked persistent
in the page specification? This sounds like a problem somewhere else...

Keep me updated,

Daniel


On 9/21/06, Claus Myglegaard Vagner <cv...@nordija.com> wrote:
>
> Hi,
>
> Is it possible to use the BeanForm component
> (http://beanform.sourceforge.net/) for updating a pojo with no setter
> method for a persistence id?
>
> For example I have a Group object with properties id, name, description.
> In the form only name and description is shown. I don't want to show the
> id and I don't want to have a setId(id) method on the pojo. This should
> be controlled by hibernate (with field access) completely.
>
> When there is no setter method for id - BeanForm is returning a Group
> object with a null "value" for id. This means that what should have been
> an update in the database becomes an insert since hibernate thinks that
> it is an not-persisted object (no id).
>
> Why cant the BeanForm component just update the fields in action (in the
> form) for the pojo e.g. just call setName and setDecription and leave
> the id intact?
>
> Regards Claus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

BeanForm and no setter method for persistence id

Posted by Claus Myglegaard Vagner <cv...@nordija.com>.
Hi,

Is it possible to use the BeanForm component 
(http://beanform.sourceforge.net/) for updating a pojo with no setter 
method for a persistence id?

For example I have a Group object with properties id, name, description. 
In the form only name and description is shown. I don't want to show the 
id and I don't want to have a setId(id) method on the pojo. This should 
be controlled by hibernate (with field access) completely.

When there is no setter method for id - BeanForm is returning a Group 
object with a null "value" for id. This means that what should have been 
an update in the database becomes an insert since hibernate thinks that 
it is an not-persisted object (no id).

Why cant the BeanForm component just update the fields in action (in the 
form) for the pojo e.g. just call setName and setDecription and leave 
the id intact?

Regards Claus


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: tapestry-acegi form based login

Posted by Robin Ericsson <lo...@gmail.com>.
On 9/21/06, Jesper Zedlitz <je...@zedlitz.de> wrote:
> Is it possible to use a html form for login with tapestry-acegi instead of
> HTTP basic authentication?

I'd like to know that too.

> I would like to write a third part for my tutorial
> http://wiki.apache.org/tapestry/AcegiSpringJava5 about that topic.

Nice tutorial.

I can answer your other wiki question about realm name.

    <contribution configuration-id="hivemind.ApplicationDefaults">
        <default symbol="tapestry.acegi.realmName" value="Member area" />
    </contribution>

-- 
        regards,
        Robin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: tapestry-acegi form based login

Posted by Jonathan Barker <jo...@gmail.com>.
My approach predates tapestry-acegi, but I'm sure it could be adapted.

I use a bit of a hybrid approach, where the authentication part is handled
as described in the EWDT e-book and all of my protected pages extend a
BaseProtectedPage class. My Login page has a UserValidator ASO injected,
which in turn has an Acegi AuthenticationManager wired in by a
UserValidatorFactory.

My UserValidator ASO has validateUser(String username, String password)
method that returns a UserProfile object (that implements Acegi's
UserDetails).  It invokes the AutheticationManager's authenticate method and
stores the Authentication object into the SecurityContext.  This replaces
the pure-Acegi login form handling and allows me to use the EWDT style.

There is also a convenience method checkPermission(String ifAnyGranted,
String ifAllGranted, String ifNotGranted) that behaves like the Acegi's JSP
taglib Authorize tag so I can make fine-grained decisions within a page.


Jonathan


> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Jesper Zedlitz
> Sent: Thursday, September 21, 2006 8:30 AM
> To: users@tapestry.apache.org
> Subject: tapestry-acegi form based login
> 
> Is it possible to use a html form for login with tapestry-acegi instead of
> HTTP basic authentication?
> 
> I would like to write a third part for my tutorial
> http://wiki.apache.org/tapestry/AcegiSpringJava5 about that topic.
> 
> Jesper
> 
> --
>  Jesper Zedlitz   E-Mail   : jesper@zedlitz.de
>                   Homepage : http://www.zedlitz.de
>                   ICQ#     : 23890711
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org