You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Krishna Kant T <kr...@compulsesys.com> on 2002/06/10 14:13:17 UTC

Re: Newbie Contexts

hi there,

u can set up new contexts by adding new directories within webapps.
each dir could be a context/app and could have dirs for jsp , images , web-inf,
etc.

~krishnakant

Mark Senefsky wrote:

> Greetings all...
>
> OK I think the solution to my previous email "Newbie Help (the sequel)" is
> related to contexts. Currently the only context for my server points to the
> examples directory.
>
> How do I establish new Contexts?
>
> Using Tomcat admin what goes in each of these inputs?
>
> Path: (assume directory path?)
> Document Base: (no clue.)
> Context Name: (whatever I choose?)
>
> Thanks,
> Mark
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com


more Newbie Contexts

Posted by Gary Dale <ga...@mail1.moh.gov.on.ca>.
How do you set up a virtual host for say the admin programs so that you 
could simply ask for http://admin.domain.dom/ rather than 
http://server.domain.dom/admin/ (assuming that the appropriate DNS 
entries have been created)?



Re: Newbie Contexts

Posted by Mark Senefsky <ms...@yahoo.com>.
Thanks Nitin...

I think this is what you told me to add to server.xml:
        <Context path="http://www.mydomain.com/"
                 docBase="/usr/local/www/htdocs/"
                 crossContext="false"
                 debug="0"
                 reloadable="true" >
        </Context>
I restarted tomcat and I get the same 404 error when I try to load the jsp.

Thanks,
Mark

> From: Nitin Borwankar <ni...@borwankar.com>
> Reply-To: tomcat-user@jakarta.apache.org
> Date: Sun, 10 Jun 2001 18:22:17 -0700
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Newbie Contexts
> 
> 
> 
> Mark Senefsky wrote:
>> 
>> Can I establish a context that points to a directory outside the tomcat
>> directory?
> 
> Yes this is definitely possible.
> Edit the server.xml file in the TOMCAT_HOME/conf directory.
> Add a new "context" entry using the existing ones as guidelines.
> "path" and "docBase" are the only one's you'll need to change.
> 
> For the "path" give a URL prefix for your jsp, for docBase give an
> absolute path pointing
> to your directory.  The URL address will still be <host>/<context
> path>/some.jsp but your jsp's will come from your new location as in
> docBase.. 
> 
> Nitin Borwankar.
> 
>> 
>> Thanks,
>> Mark
>> 
>>> From: Krishna Kant T <kr...@compulsesys.com>
>>> Organization: ComPulse Systems
>>> Reply-To: tomcat-user@jakarta.apache.org
>>> Date: Mon, 10 Jun 2002 17:43:17 +0530
>>> To: tomcat-user@jakarta.apache.org
>>> Subject: Re: Newbie Contexts
>>> 
>>> hi there,
>>> 
>>> u can set up new contexts by adding new directories within webapps.
>>> each dir could be a context/app and could have dirs for jsp , images ,
>>> web-inf,
>>> etc.
>>> 
>>> ~krishnakant
>>> 
>>> Mark Senefsky wrote:
>>> 
>>>> Greetings all...
>>>> 
>>>> OK I think the solution to my previous email "Newbie Help (the sequel)" is
>>>> related to contexts. Currently the only context for my server points to the
>>>> examples directory.
>>>> 
>>>> How do I establish new Contexts?
>>>> 
>>>> Using Tomcat admin what goes in each of these inputs?
>>>> 
>>>> Path: (assume directory path?)
>>>> Document Base: (no clue.)
>>>> Context Name: (whatever I choose?)
>>>> 
>>>> Thanks,
>>>> Mark
>>>> 
>>>> _________________________________________________________
>>>> Do You Yahoo!?
>>>> Get your free @yahoo.com address at http://mail.yahoo.com
>> 
>> _________________________________________________________
>> Do You Yahoo!?
>> Get your free @yahoo.com address at http://mail.yahoo.com


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re: Newbie Contexts

Posted by Nitin Borwankar <ni...@borwankar.com>.

Mark Senefsky wrote:
> 
> Can I establish a context that points to a directory outside the tomcat
> directory?

Yes this is definitely possible.
Edit the server.xml file in the TOMCAT_HOME/conf directory.
Add a new "context" entry using the existing ones as guidelines.
"path" and "docBase" are the only one's you'll need to change.

For the "path" give a URL prefix for your jsp, for docBase give an
absolute path pointing 
to your directory.  The URL address will still be <host>/<context
path>/some.jsp but your jsp's will come from your new location as in
docBase.. 

Nitin Borwankar.

> 
> Thanks,
> Mark
> 
> > From: Krishna Kant T <kr...@compulsesys.com>
> > Organization: ComPulse Systems
> > Reply-To: tomcat-user@jakarta.apache.org
> > Date: Mon, 10 Jun 2002 17:43:17 +0530
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: Newbie Contexts
> >
> > hi there,
> >
> > u can set up new contexts by adding new directories within webapps.
> > each dir could be a context/app and could have dirs for jsp , images ,
> > web-inf,
> > etc.
> >
> > ~krishnakant
> >
> > Mark Senefsky wrote:
> >
> >> Greetings all...
> >>
> >> OK I think the solution to my previous email "Newbie Help (the sequel)" is
> >> related to contexts. Currently the only context for my server points to the
> >> examples directory.
> >>
> >> How do I establish new Contexts?
> >>
> >> Using Tomcat admin what goes in each of these inputs?
> >>
> >> Path: (assume directory path?)
> >> Document Base: (no clue.)
> >> Context Name: (whatever I choose?)
> >>
> >> Thanks,
> >> Mark
> >>
> >> _________________________________________________________
> >> Do You Yahoo!?
> >> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com

Re: Newbie Contexts

Posted by Mark Senefsky <ms...@yahoo.com>.
Thanks for the help...

What I'd really like to do is be able to run jsp's and servlets through my
root web directory without having to add the files to examples/*. For
example: http://www.mydomain.com/cart.jsp instead of:
http://www.mydomain.com/examples/jsp/cart.jsp

How is this accomplished?
Can I establish a context that points to a directory outside the tomcat
directory?

Thanks,
Mark

> From: Krishna Kant T <kr...@compulsesys.com>
> Organization: ComPulse Systems
> Reply-To: tomcat-user@jakarta.apache.org
> Date: Mon, 10 Jun 2002 17:43:17 +0530
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Newbie Contexts
> 
> hi there,
> 
> u can set up new contexts by adding new directories within webapps.
> each dir could be a context/app and could have dirs for jsp , images ,
> web-inf,
> etc.
> 
> ~krishnakant
> 
> Mark Senefsky wrote:
> 
>> Greetings all...
>> 
>> OK I think the solution to my previous email "Newbie Help (the sequel)" is
>> related to contexts. Currently the only context for my server points to the
>> examples directory.
>> 
>> How do I establish new Contexts?
>> 
>> Using Tomcat admin what goes in each of these inputs?
>> 
>> Path: (assume directory path?)
>> Document Base: (no clue.)
>> Context Name: (whatever I choose?)
>> 
>> Thanks,
>> Mark
>> 
>> _________________________________________________________
>> Do You Yahoo!?
>> Get your free @yahoo.com address at http://mail.yahoo.com


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com