You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Asad <as...@cmcltd.com> on 2003/06/11 10:55:16 UTC

Submit Problem

Hi all,

We are integrating JAAS with Turbine.

The JAAS module sends a series of VM's to the user screen for authentication
( using requestdispatcher)

This JAAS module is called from an Action class.

The problem is that  I am not able to send the values in one click
from the vm file back to the action class at the server.
I need to hit the submit button twice for it to reach the server.
can anybody throw some light on why this happening.

Thanks and Regards
Asad


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Submit Problem

Posted by Eric Emminger <er...@ericemminger.com>.
Asad

> can u please elaborate a little more on how to use the isAuthorized method.

Make your screen class extend 
org.apache.turbine.modules.screens.VelocitySecureScreen and use the 
isAuthorized method. You may find an example in the TDK - Flux?

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Submit Problem

Posted by Asad <as...@cmcltd.com>.
Hi Eric

> If your JAAS implementation is in the same Turbine servlet, then you
> shouldn't need a RequestDispatcher. You should be able to call your JAAS
> methods from the isAuthorized method in your actions and screens.

    what we are doing with the RequestDispatcher is calling the VM from
servlet using
forward method.

then we make a sleep in the calling class,and give the control to the VM
file.

can u please elaborate a little more on how to use the isAuthorized method.

Thanks for your help.


> Eric


Regards
Asad
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Submit Problem

Posted by Eric Emminger <er...@ericemminger.com>.
Asad

Asad wrote:
> Hi Eric,
>     Thanks for your help.
> 
> 
>>Why are you using RequestDispatcher? Is JAAS in a separate servlet than
> 
>  >Turbine?
> 
> JAAS class is implemented in normal Java class, this class is being called
> from
> our action class.
> 
> we pass the request and response objects from action class to that class,and
> from there
> we call the requestdispatcher.
> 
>  > To where does the form in your VM submit? A Turbine action? Your JAAS
> 
>>servlet?
> 
> 
> The form submit takes back to the Turbine Action.

If your JAAS implementation is in the same Turbine servlet, then you 
shouldn't need a RequestDispatcher. You should be able to call your JAAS 
methods from the isAuthorized method in your actions and screens.

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Submit Problem

Posted by Asad <as...@cmcltd.com>.
Hi Eric,
    Thanks for your help.

> Why are you using RequestDispatcher? Is JAAS in a separate servlet than
 >Turbine?

JAAS class is implemented in normal Java class, this class is being called
from
our action class.

we pass the request and response objects from action class to that class,and
from there
we call the requestdispatcher.

 > To where does the form in your VM submit? A Turbine action? Your JAAS
> servlet?

The form submit takes back to the Turbine Action.

> > There are no errors shown in the logs .
> > And we have modifed the Turbine.Java src to print a msg on screen
whenever
> > it recieves a GET/POST msg.
> > Even that msg is not getting printed.
>
> You may want to get logging working or find some way to perform some
> tests, such as with JUnit or HttpUnit, etc.
>
> This may work better as a service or pull tool.

I will look into that.
>
> Eric

Thanks and Regards
Asad

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Submit Problem

Posted by Eric Emminger <er...@ericemminger.com>.
Asad

Asad wrote:
> what we are doing is we are reading the JAAS config file name in our action
> class,
> This config file we are passing to our Java class(LoginContext - JAAS),
> which call the CallBackhandler(JAAS) , which uses the
> 
> HttpRequest.getRequestDispatcher("VM filename").forward(Request,Response)

Why are you using RequestDispatcher? Is JAAS in a separate servlet than 
Turbine?

> to call the vm file, after this we call sleep in our callbackhandler to pass
> control to VM .
> 
> After we get the data (username and password ) from VM file, we call notify
> to wake up our
> sleeping thread.
> which does the data validation.

To where does the form in your VM submit? A Turbine action? Your JAAS 
servlet?

> There are no errors shown in the logs .
> And we have modifed the Turbine.Java src to print a msg on screen whenever
> it recieves a GET/POST msg.
> Even that msg is not getting printed.

You may want to get logging working or find some way to perform some 
tests, such as with JUnit or HttpUnit, etc.

This may work better as a service or pull tool.

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Submit Problem

Posted by Asad <as...@cmcltd.com>.
> I don't understand. How is JAAS sending Velocity templates (VM's) to a
> screen?

what we are doing is we are reading the JAAS config file name in our action
class,
This config file we are passing to our Java class(LoginContext - JAAS),
which call the CallBackhandler(JAAS) , which uses the

HttpRequest.getRequestDispatcher("VM filename").forward(Request,Response)

to call the vm file, after this we call sleep in our callbackhandler to pass
control to VM .

After we get the data (username and password ) from VM file, we call notify
to wake up our
sleeping thread.
which does the data validation.



> That's very odd and, obviously, should not be happening. Have you
> checked your logs? Can you provide more details, such as an error with a
> stack trace?

There are no errors shown in the logs .
And we have modifed the Turbine.Java src to print a msg on screen whenever
it recieves a GET/POST msg.
Even that msg is not getting printed.



> Eric

Thanks
Asad


>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Submit Problem

Posted by Eric Emminger <er...@ericemminger.com>.
Asad

Asad wrote:
> Hi all,
> 
> We are integrating JAAS with Turbine.
> 
> The JAAS module sends a series of VM's to the user screen for authentication
> ( using requestdispatcher)

I don't understand. How is JAAS sending Velocity templates (VM's) to a 
screen?

> 
> This JAAS module is called from an Action class.
> 
> The problem is that  I am not able to send the values in one click
> from the vm file back to the action class at the server.
> I need to hit the submit button twice for it to reach the server.
> can anybody throw some light on why this happening.

That's very odd and, obviously, should not be happening. Have you 
checked your logs? Can you provide more details, such as an error with a 
stack trace?

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org