Oops, a check of the API would have shown that it is
request.getContextPath() anyways.

PS All this is in the API, my suggestion was hastily written but should
have pointed you in the right direction...

On Tue, 17 Apr 2001, Johan Fredriksson wrote:

> Nope, when doing just that I get...
> 
> 
> 500 Internal Server Error
> Error parsing JSP page /aller/Allas/subscriber.jsp
> 
> Syntax error in source/Allas/subscriber.jsp.java:32: Method getContextPath()
> not found in interface javax.servlet.ServletContext. (JSP page line 8)
> 
>       String servletPath = pageContext.getServletContext().getContextPath();
>                                                                          ^
> 1 error
> 
> 
> 
> 
> 
> 
> 
> ----- Original Message -----
> From: "Hani Suleiman" <[EMAIL PROTECTED]>
> To: "Orion-Interest" <[EMAIL PROTECTED]>
> Sent: Wednesday, April 11, 2001 5:30 PM
> Subject: Re: Application mapping - how do I know it from within the app?
> 
> 
> > pageContext.getServletContext().getContextPath()
> >
> > On Wed, 11 Apr 2001, Johan Fredriksson wrote:
> >
> > > I'm using virtual hosts in my development to make sure that all links
> are correctly set, that is I can access the same app in two ways, either via
> > >
> > > appname.localhost
> > >
> > > or
> > >
> > > localhost/appname
> > >
> > > .
> > >
> > > The problem is that I'm not sure how to figure out on a jsp page which
> entry point was used, and this causes problem when I'm trying to map my
> servlet, since relative paths to servlets does not seem to work...
> > >
> > > String parsing of request.getRequestURI() seems like a way to start, but
> I'm not sure what how to write it, since in the future the app might be
> moved again to
> > >
> > > appname.serviceprovider.localhost
> > >
> > > vs
> > >
> > > localhost/serviceprovider/appname
> > >
> > > .
> > >
> > > Is there a way to get pageContext return application context?
> > >
> > >
> > >
> > > Johan
> > >
> >
> 
> 
> 


Reply via email to