You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Juanjo C <jj...@gmail.com> on 2010/01/08 11:08:21 UTC

Re: Additional validation for j_security_check action

Sorry for use this thread, but I'm desperate....

Dani, How to use Struts 2 with JAAS? I have my own implementation of JAAS
that works fine in applications without Struts, but don't works if I use it
into Strust.....

Can you help me?

2009/6/17 Wes Wannemacher <we...@wantii.com>

> I have thought about this a bit lately and I never came up with a good
> solution. In this case, you are sort of hacking the framework by using
> our view library to render the UI, but the processing happens
> elsewhere. That's why I don't know if there is a good solution to
> sprinkle in some validation as well, since validation is handled as a
> function of the processing.
>
> I have thought about trying to put an action out in front of
> j_security_check. I am not sure if it would work, but you can try to
> create a thin action that has the getters/setters for j_username /
> j_password, then dispatch to j_security_check. I don't know if you're
> feeling up to it, but if you hack around enough and find a way to
> pre-process the form with struts then hand it off to j_security_check,
> I'd be interested in how you did it.
>
> -Wes
>
> On Wed, Jun 17, 2009 at 11:06 AM, Daniil Petrov<pe...@gmail.com> wrote:
> > Hi,
> >
> > I am using JAAS authentication in a Struts 2 web application. A login
> form
> > looks like:
> >
> >    <s:form method="post" action="j_security_check">
> >        <s:textfield label="User" name="j_username"/>
> >        <s:password label="Password" name="j_password"/>
> >        <s:submit value="Log In"/>
> >    </s:form>
> >
> > I need to validate password field before passing it to the authentication
> > service. Basically, I need to check that this field is not empty. Struts
> 2
> > suggests two ways for validation: either implement validate() method in
> > action or configure field validators in xml file. But in this case I do
> not
> > have a particular action, because j_security_check is something
> > container-dependent. What validation can be done in this case?
> >
> > Thanks,
> > Daniil
> >
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>