The lightbulbs went off after I hit "Send" on that last post.
Is the SOAPContext the means of getting at the ServletContext?
Ie, is this the basic idea?:
void myMethod( SOAPContent context, ...)
{
HttpServletRequest request =
(HttpServletRequest)SOAPContext.getProperty(Constants.BAG_HTTPSERVLETREQUEST);
String contextPath = request.getContextPath();
ServletContext emptyContext = new ServletContext();
ServletContext context = emptyContext.getContent(contextPath);
String configFilename = context.getInitParameter( "my-config" );
//...
}
-Chris
Chris Malley wrote:
>
> Unless I've misunderstood... I think that Steve is asking for
> the ServletContext (or ServletConfig), not the SOAPContext.
>
> I'm also interested in how to get at the ServletContext from within
> a Java class hosted by one of the Apache SOAP servlet. I'd like to
> be able to call ServletContext.getInitParameter to get parameters
> defined in soap/WEB-INF/web.xml.
>
> -Chris
>
> Shinta Tjio wrote:
> >
> > You can define your SOAP method to take SOAPContext, then use
> > the SOAPContext.getProperty(Constants.BAG_HTTPSERVLETREQUEST)
> > to get the HttpServletRequest.
> >
> > -shinta
> >
> > > -----Original Message-----
> > > From: sbelt [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, January 07, 2002 1:01 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: getContextPath in a soap-hosted class?
> > >
> > >
> > > Hello!
> > >
> > > I am brand new to SOAP (and this list), so I hope my question
> > > is relevant. I
> > > did search the archives; I am still finding my footing in
> > > this technology,
> > > but I don't *think* my question was answered there.
> > >
> > > I have a class that I would like to host on the Apache Soap
> > > server (2.2 on
> > > Tomcat-4.x). My class needs to access a file for .ini-type
> > > information. In a
> > > servlet, I could find this file using (pseudo code):
> > >
> > > file.open(request.getContextPath() + "/WEB-INF/settings.init")
> > >
> > > Is there a way for me to find my context root in a class
> > > being hosted by the
> > > soap server?
> > >
> > > TIA,
> > >
> > > Steve B.
--
Chris Malley
PixelZoom, Inc. Voice: +1.303.494.8849
835 Orman Drive EMail: [EMAIL PROTECTED]
Boulder CO 80303-2616