Yes, an interceptor would probably be a better choice. Nils-H
On Thu, Nov 20, 2008 at 8:26 AM, Andreas Sachs <[EMAIL PROTECTED]> wrote: > > Hello, > i want to put a object in every new session which provides basic sessionbased > functionality. E.g. > > isUserLoggedIn(); > getUser(); > getMenu(); (the menu depends on the user) > > public ...sessionCreated() { > MainManager mM = new mainManager() > session.setattribut("mainManager",mM) > } > > Within the jsp i use: > > #session.mM.user.name > or > #session.mM.menu.... > > I can initilize the session in the action, but i have some actions which are > not sessionAware, because they don't need that. E.g. the start-page. It > simply returns the welcome-result. With a new session #session.mM is not > available in the jsp because the sessionCreated-Method is called to late (At > least it looks like that). > > Maybe i should initialize the session with an interceptor. > > Thanks > Andi > > > > -------- Original-Nachricht -------- >> Datum: Wed, 19 Nov 2008 19:25:54 +0100 >> Von: "Nils-Helge Garli Hegvik" <[EMAIL PROTECTED]> >> An: "Struts Users Mailing List" <user@struts.apache.org> >> Betreff: Re: [S2] Session Created to late > >> What is it exactly that you want to achieve? >> >> Nils-H >> >> On Wed, Nov 19, 2008 at 6:51 PM, Andreas Sachs <[EMAIL PROTECTED]> wrote: >> > Hello, >> > i try to initialize a session with a HttpSessionListener class. >> > >> > The sessionCreated-Method is called AFTER setSession(Map map) of an >> Action-Class with SessionAware interface. >> > >> > Whats the right way to initilize a session when using struts2? >> > >> > Thanks >> > Andi >> > >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] > > -- > Sensationsangebot nur bis 30.11: GMX FreeDSL - Telefonanschluss + DSL > für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]