Hi Frédéric,

try this, within your LoginUser class, try not to create the Context. do it 
different. 

When the User has logged in successfully, set a marker. 
data.getUser().setTemp("initialize", Boolean.TRUE);

then within the doBuildTemplate(RunData data, Context context) check for the 
value

if(data.getUser().getTemp("initialize") != null && 
((Boolean)data.getUser().getTemp("initialize")).booleanValue() == true)
{
        //initialize your services here
}

This is better, because Turbine will initialize the context after your 
LoginAction again, and hand it over to your screens.

Just curious How are you testing your Turbine App (With which Tool)? I would 
really like to reproduce the scenario on the sample app and see what is 
happening there.

Kind regards

Juergen Hoffmann

Am Montag, 24. Juli 2006 15:44 schrieb Frédéric KERNEUZET:
> Hi Jürgen,
>
>
>
> A context is instanciated in the LoginUser class because after the
> login/password have been verified, some properties of the user are set to
> prepare the next screen, like UIManager (there’s two differents skins,
> choice depending on a user propertie).
>
> Besides, I need a context here to set some parameters in the user session.
>
>
>
> About my previous message, my sentence was not very clear : I disabled all
> my own services.
>
>
>
> But I left these ones :
>
> ===============
>
> tool.request.link=org.apache.turbine.services.pull.tools.TemplateLink
>
> tool.request.page=org.apache.turbine.util.template.HtmlPageAttributes
>
> tool.request.content=org.apache.turbine.services.pull.tools.ContentTool
>
> tool.request.l10n=org.apache.turbine.services.localization.LocalizationTool
>
> tool.request.flux=org.apache.turbine.flux.tools.FluxTool
>
> tool.request.dateFormatter=org.apache.turbine.services.pull.util.DateFormat
>t er
>
> tool.session.sessionData=org.apache.turbine.services.pull.util.SessionData
>
> tool.request.om=org.apache.turbine.om.OMTool
>
> tool.request.intake=org.apache.turbine.services.intake.IntakeTool
>
> tool.session.ui=org.apache.turbine.services.pull.util.UIManager
>
> tool.ui.skin=default
>
>
>
> The real point that surprise me is why calling the context takes so much
> time ?!
>
>
>
> Here the begin of my source code of LoginUser.java :
>
> ======================================
>
>
>
> public void doPerform(RunData data)
>
>     throws TurbineSecurityException
>
>     {
>
> Date heureDebut = new Date();
>
> log.debug("LoginUser ("+heureDebut.getTime()+") => Begin of doPerform
> method
>
> : "+heureDebut.getTime());
>
>             String username = data.getParameters().getString(CGI_USERNAME,
> "");
>
>             String password = data.getParameters().getString(CGI_PASSWORD,
> "");
>
>
>
>             // Authenticate the user and get the object.
>
>             User user = TurbineSecurity.getAuthenticatedUser(
>
>             username, password);
>
>
>
>             log.debug("LoginUser ("+heureDebut.getTime()+") => Get the
> context : "+(new Date()).getTime());
>
>
>
>             // Get context in order to get sessionData
>
>             context = TurbineVelocity.getContext(data);
>
>             log.debug("LoginUser ("+heureDebut.getTime()+") => Get the
> sessionData : "+(new Date()).getTime());
>
>
>
>             // Get sessionData from context
>
>             sessionData = (SessionData) context.get("sessionData");
>
>
>
>
>
>             ….
>
>
>
> log.debug("LoginUser ("+heureDebut.getTime()+") => End of doPerform method:
> "+(new Date()).getTime());
>
> //Redirect to Home.vm
>
> }
>
>
>
> And the log trace for one user connecting to the application :
>
>
>
> 2006-07-24 15:17:39,060 [http8080-Processor4] DEBUG
> modules.actions.LoginUser - LoginUser (1153747059060) => Begin of doPerform
> method : 1153747059060
>
> 2006-07-24 15:17:39,080 [http8080-Processor4] DEBUG
> modules.actions.LoginUser - LoginUser (1153747059060) => Get the context :
> 1153747059080
>
>
>
> Here => 1663 calls of TurbineServices.getInstance() !
>
>
>
> 2006-07-24 15:17:39,541 [http8080-Processor4] DEBUG
> modules.actions.LoginUser - LoginUser (1153747059060) => Get the
> sessionData
>
> : 1153747059541
>
> 2006-07-24 15:17:39,551 [http8080-Processor4] DEBUG
> modules.actions.LoginUser - LoginUser (1153747059060) => End of doPerform
> method : 1153747059551
>
>
>
>
>
> As you can see, user connection takes 491ms, with 461ms when getting the
> context.
>
>
>
> Besides, I realize that 5622 calls were done during the “redirection” to
> the main page of application (so, just AFTER the end of LoginUser.java and
> BEFORE the begin of doPerform method of Home page).
>
>
>
> This looks quite strange for me, so I think it could come from a
> configuration mistake I’ve done … but I don’t see where !
>
>
>
>
>
> Sorry to disturb you with my little problems ;o), and thanks a lot Jürgen
> to take time trying to help me !
>
> Regards,
>
> Frederic.
>
> ================================
>
> Frédéric KERNEUZET
>
> Chef de projet N-Tiers
>
>
>
> Centre de développement ABASE Nantes
>
> 2 rue du Recteur Yves Pironneau
>
> 44300 Nantes
>
> Tel. : 02.90.87.01.51
>
> Mail : [EMAIL PROTECTED]
>
> ================================
>
>
>
> !EXCUBATOR:1,44c4d21043381457015815!

-- 
Kind regards

Juergen 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to