I failed to get anything from the link
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet
..wait let me rephrase that... it resulted in a 'sorry, we could not get
the file you requested error'
Thank yoy all by the way for your suggestions... I have yet to try them
out... I'll be back with feedback as soon as i do...
by the the packages are to be used with XSPs, not servlets...
:)
Most Grateful -
kazi
----- Original Message -----
From: "Heath, Joseph" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 09, 2001 9:51 PM
Subject: RE: getting the ServerName
> Its depends on whether Kazi meant getServerName() or getServletName() .. I
> was assuming he made a spelling mistake (its a frequent compiler warning
on
> my box) ..
> As you cant get access to the Servlet through the ServletContext
(deprecated
> and doesn't work anymore)...
>
> But if you want the ServerName yes do that...;-)
>
> > -----Original Message-----
> > From: Mills, Theo [mailto:[EMAIL PROTECTED]]
> > Sent: 09 August 2001 14:37
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: getting the ServerName
> >
> >
> > Actually there's a more direct method in
> > javax.servlet.ServletContext.getServerInfo().
> >
> > Check it out:
> >
> > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet
> > /ServletContex
> > t.html
> >
> > Hope this helps.
> >
> > -----Original Message-----
> > From: Heath, Joseph [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, August 09, 2001 5:22 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: getting the ServerName
> >
> >
> > Your classes will not know where they are being run..
> > You have to pass some kind of context in to them..
> > I normally use a ref to the servlet through the constructor
> > eg..
> >
> > public class MyExample {
> >
> > private HttpServlet context;
> >
> > public MyExample(HttpServlet context) {
> > this.context = context;
> > }
> >
> > public void doSomething() {
> > String name = context.getServletName();
> > }
> > }
> > ........
> > In the servlet
> >
> > MyExample eg = new MyExample(this);
> >
> > > -----Original Message-----
> > > From: Kazi the P i R @ t {- [mailto:[EMAIL PROTECTED]]
> > > Sent: 09 August 2001 11:11
> > > To: [EMAIL PROTECTED]
> > > Subject: getting the ServerName
> > >
> > >
> > > how can one of my packages (not a servlet) access the
> > > server's name?? I
> > > attempted to use the HttpServletRequest object in isolation
> > > and using the
> > > function getServletName() to achieve my goals... but it
> > > failed. It was just
> > > a shot in the dark...
> > >
> > > Now i am turning to you all... shed some light on my target
> > >
> > > including
> > > Thank Yous In Advance
> > >
> > > kazi
> > >
> >
>