You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Neil Aggarwal <ne...@JAMMConsulting.com> on 2001/12/16 21:29:54 UTC
How to get webapp name
Hello:
Is there a way to get the webapp name in a JSP page?
Thanks,
Neil.
--
Neil Aggarwal
JAMM Consulting, Inc. (972) 612-6056, http://www.JAMMConsulting.com
Custom Internet Development Websites, Ecommerce, Java, databases
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: How to get webapp name
Posted by Mahesh Vaidya <fo...@yahoo.com>.
Hi,
I think you are looking for information about current servlet, isn't it ?
you can use
ServletContext sc = getServletContext();
out.println("Context is " + sc.getRealPath("/"));
Thanks
....
Neil Aggarwal wrote:
>Hello:
>
>Is there a way to get the webapp name in a JSP page?
>
>Thanks,
> Neil.
>
>--
>Neil Aggarwal
>JAMM Consulting, Inc. (972) 612-6056, http://www.JAMMConsulting.com
>Custom Internet Development Websites, Ecommerce, Java, databases
>
>--
>To unsubscribe: <ma...@jakarta.apache.org>
>For additional commands: <ma...@jakarta.apache.org>
>Troubles with the list: <ma...@jakarta.apache.org>
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: How to get webapp name
Posted by Yoav Shapira <sh...@mpi.com>.
Hi,
Maybe what you're looking for is the webapp's context, and for
that you can try HttpServletRequest.getContextPath():
public java.lang.String getContextPath()
Returns the portion of the request URI that indicates the context of the
request. The context path always comes first in a request URI. The path
starts with a "/" character but does not end with a "/" character. For
servlets in the default (root) context, this method returns "".
Returns:
a String specifying the portion of the request URI that indicates the
context of the request
Yoav
Neil Aggarwal wrote:
>
> Micael:
>
> I am looking for the name of the web application.
>
> For example, if I look at http://dev.leads-unlimited.com/leads/index.jsp
>
> The webapp name is leads.
>
> It is the same name as the directory that contains the
> JSP files.
>
> Thanks,
> Neil.
>
> --
> Neil Aggarwal
> JAMM Consulting, Inc. (972) 612-6056, http://www.JAMMConsulting.com
> Custom Internet Development Websites, Ecommerce, Java, databases
>
> > -----Original Message-----
> > From: Micael Padraig Og mac Grene [mailto:caraunltd@harbornet.com]
> > Sent: Sunday, December 16, 2001 4:04 PM
> > To: Tomcat Users List
> > Subject: Re: How to get webapp name
> >
> >
> > At 02:29 PM 12/16/01 -0600, you wrote:
> > >Hello:
> > >
> > >Is there a way to get the webapp name in a JSP page?
> > >
> > >Thanks,
> > > Neil.
> >
> >
> > Hi, Neil,
> >
> > Cannot tell what ou want here. Try stating it differently. What do you
> > mean by "webapp"?
> >
> > -- micael
> >
> >
> > --
> > To unsubscribe: <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
>
> --
> To unsubscribe: <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
RE: How to get webapp name
Posted by Neil Aggarwal <ne...@JAMMConsulting.com>.
Micael:
I am looking for the name of the web application.
For example, if I look at http://dev.leads-unlimited.com/leads/index.jsp
The webapp name is leads.
It is the same name as the directory that contains the
JSP files.
Thanks,
Neil.
--
Neil Aggarwal
JAMM Consulting, Inc. (972) 612-6056, http://www.JAMMConsulting.com
Custom Internet Development Websites, Ecommerce, Java, databases
> -----Original Message-----
> From: Micael Padraig Og mac Grene [mailto:caraunltd@harbornet.com]
> Sent: Sunday, December 16, 2001 4:04 PM
> To: Tomcat Users List
> Subject: Re: How to get webapp name
>
>
> At 02:29 PM 12/16/01 -0600, you wrote:
> >Hello:
> >
> >Is there a way to get the webapp name in a JSP page?
> >
> >Thanks,
> > Neil.
>
>
> Hi, Neil,
>
> Cannot tell what ou want here. Try stating it differently. What do you
> mean by "webapp"?
>
> -- micael
>
>
> --
> To unsubscribe: <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: How to get webapp name
Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 02:29 PM 12/16/01 -0600, you wrote:
>Hello:
>
>Is there a way to get the webapp name in a JSP page?
>
>Thanks,
> Neil.
Hi, Neil,
Cannot tell what ou want here. Try stating it differently. What do you
mean by "webapp"?
-- micael
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>