You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Edgar González <eg...@valhallaproject.com> on 2004/04/16 16:55:11 UTC

Why cleanup the template context after LoginAction ?

Hi,

Anibal is right the problem with LoginAction is because the Turbine servlet
clean the template context alter execute the LoginAction.

Reading the CVS annontations, I found that Henning said that he coded in
this way, to fix a bug related to session pull-tools. But with this code if
the LoginAction (in my case this extends VelocityAction) put some object
into the the context, it isn't available in the template. The same happens
with the request pull-tools, if the LoginAction modified a request tool,
this modification isn't available in the template, because ALL the template
context is cleaned and then rebuilded (with a "clean" request tool).

So, why to break all the standard functionality of
Pull-Tools+Context+Actions+Screens in the LoginAction? 

Why not to just remove the session pull-tools from the context, after the
LoginAction, and to remove ALL the context?

Any comment? Am I missing something?

TIA

----------------------------------------------------------------------------
Edgar González González
VALHALLA Project, s.a.
Chief Technology Officer
Web: www.valhallaproject.com
E-mail: egg@valhallaproject.com / egg@cantv.net
Phone: +58-212-242.4379 / 6662 / 4055 / 6475
Fax: +58-212-242.6809 
"The limits of my language mean the limits of my world."
Ludwig Wittgenstein 
----------------------------------------------------------------------------



-----Mensaje original-----
De: Aníbal Rojas [mailto:ard@valhallaproject.com] 
Enviado el: Jueves, 15 de Abril de 2004 05:49 p.m.
Para: Turbine Users List
Asunto: Re: Integrating commons-validator in Turbine - Strange behavior in
Login action

Ok, the problem is in the turbine servlet, in the login action:

    private void loginAction(RunData data)
            throws Exception
    {
        ActionLoader.getInstance().exec(data, data.getAction());
        cleanupTemplateContext(data);
        data.setAction(null);
    }

The   cleanupTemplateContext(data) is intended to clean the Velocity Context
if available (actually it does)

This change is supposed to prevent the use of Tools based in a anon user
after there has been a succesful login into the app. But in the case of the
request based tools this seems inconvenient.

Aníbal Rojas
ard@valhallaproject.com
58+212+242.66.62 / 43.79
Fax: 58+212+243.68.09

----- Original Message ----- 
From: "Edgar González" <eg...@valhallaproject.com>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
Sent: Thursday, April 15, 2004 3:54 PM
Subject: Integrating commons-validator in Turbine - Strange behavior in
Login action


Hi,



I have been working in the integration of commons-validator in Turbine.



I'm following the same approach used by Intake, a service and a request
pull-tool.



After a developed the service and the request pull-tool, I started to test
them using a Login Form.



My Login Action is a custom action which extends VelocityAction , because I
use some custom request tool like scarab does (scarabR).



But when the LoginAction is going to be executed all the request pull-tools
are initialized before AND AFTER, so in the Login template, the values
setted in the tools by the action are missing.



I copied the LoginAction code to other action, and tested it, and everything
works fine. The request tool are initialized only before the action is
executed.



What's happening with the pull-service and the LoginAction.?



I debugged the TurbinePullService and the log shows that the
populateWithRequestTools method is executed before and AFTER the LoginAction
execution



Any clue?



TIA

----------------------------------------------------------------------------
Edgar González González
VALHALLA Project, s.a.
Chief Technology Officer
Web:  <BLOCKED::http://www.valhallaproject.com/> www.valhallaproject.com
E-mail:  <BL...@valhallaproject.com> egg@valhallaproject.com /
<BL...@cantv.net> egg@cantv.net
Phone: +58-212-242.4379 / 6662 / 4055 / 6475
Fax: +58-212-242.6809
"The limits of my language mean the limits of my world."
Ludwig Wittgenstein
----------------------------------------------------------------------------






---------------------------------------------------------------------
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