struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Marco.Mistr...@nokia.com>
Subject RE: question about struts
Date Fri, 20 Jun 2003 11:42:50 GMT
Hi,
	
> The ActionServlet has a reference to the servlet context which may be
> retrieved using:
> servlet.getServletContext()
> Using the servlet reference passed to your plugins init() method.
> 
> Your plugin would initialise those objects you want stored in 
> the servlet
> context, and then store them there. The plugin itself doesnt 
> need to be
> stored as its job is just initialisation.
> 

ok, got it. and i have done it. 
but now the problem is retrieving my component from the context.
in my Action class there are no references to ActionServlet, and thus
i cannot get the ServletContext from anywhere...

any help?

regards
	marco



> 
> -----Original Message-----
> From: Marco.Mistroni@nokia.com [mailto:Marco.Mistroni@nokia.com]
> Sent: Friday, 6 June 2003 14:18
> To: struts-user@jakarta.apache.org
> Cc: dgraham1980@hotmail.com
> Subject: RE: question about struts
> 
> 
> Hi David,
> 	thanx 4 the suggestion...actually i was thinking on either use a
> plugin or extending action servlete.
> but i m left out with one issue: where actually do i have to 
> write the code
> for storing the plugin in the servlet context?
> struts docs mention
> 'The PlugIn interface extends Action and so that applications 
> can easil
> hook into the ActionServlet lifecycle.'
> and
> 'At runtime, any resource setup by init would be accessed by 
> Actions or
> business tier classes'
> 
> but how?
> 
> all the searchs that i have done shows how to configure 
> plugins,...not how
> to use..
> 
> can anyone help?
> 
> thanx and regards
> 	marco
> 
> 
> 
> 
> 
> > -----Original Message-----
> > From: ext David Graham [mailto:dgraham1980@hotmail.com]
> > Sent: 05 June, 2003 17:28
> > To: struts-user@jakarta.apache.org
> > Subject: Re: question about struts
> >
> >
> > You can use a Struts PlugIn to initialize your components and
> > store them in
> > the ServletContext.
> >
> > David
> >
> > >hi all,
> > >	i have been working with JSP model 2 for few years, and
> > now i want to move
> > >to struts.
> > >i am starting to get acquainted with it, and i need help to
> > face this
> > >situation.
> > >in my mvc, i am using 2 components, one to connect to R3 and
> > the other for
> > >connecting to DB.
> > >the lifecycle of those components is the same as my servlet,
> > since those
> > >components are not
> > >user/session/request specific.
> > >
> > >in reading docs about struts, i could not figure out where
> > to put those
> > >components in the
> > >struts framework. of course, i can put them in
> > ActionServlet, but this will
> > >require me to modify the
> > >code of the ActionServlet.
> > >
> > >is there any other way to do that other than modifying the code of
> > >ActionServlet?
> > >
> > >hope someone can help...
> > >
> > >thanx in advance and regards
> > >	marco
> > >
> > 
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: 
> struts-user-help@jakarta.apache.org
> > >
> >
> > _________________________________________________________________
> > MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> > http://join.msn.com/?page=features/virus
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

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


Mime
View raw message