aspose file tools*
The moose likes Tomcat and the fly likes how to configure the a web application directory as the root directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how to configure the a web application directory as the root directory" Watch "how to configure the a web application directory as the root directory" New topic
Author

how to configure the a web application directory as the root directory

Ravi Goli
Ranch Hand

Joined: Feb 13, 2005
Posts: 31
Hi all,

Iam a starter with building a j2EE application using tomcat or any web server.
i want to know where (i think i should ask in which xml file) do i need to configure my web application so that tomcat looks into my application directory as the root directory instead of the ROOT directory in tomcat which the tomcat looks into.

Thanks,
Ravi.
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi Ravi

its not the web.xml . Its the tomcats conf file named server.xml in conf folder of tomcat .

There u will have an entry saying
<Context path="/" docBase="ROOT"/>

just change that entry by replacing the docBase with ur applciation folder name
Ravi Goli
Ranch Hand

Joined: Feb 13, 2005
Posts: 31
hey sreenath,
I looked in the server.xml in conf folder of tomcat, but i didn't find the context tag you specified. i looked for the context tag with the attributes of path and docbase even in the rest of the xml files, but i didn't find it anywhere.
Actually, I've installed the configured version of tomcat from Marty Hall website.
I even had the one installed from apache website, but i didn't find the tag in the location you specified.
Please help.

Ravi
Ravi Goli
Ranch Hand

Joined: Feb 13, 2005
Posts: 31
somebody please reply to my question.

i didn't find any <Context path="" docbase=""> tag in the server.xml file in conf of tomcat.
iam trying to write few servlets for my web application. Iam not able to figure out how to set my web app directory as the root directory.

Ravi.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I just did this for an app called SimpleMVC by adding a Context node within the Host node of server.xml



Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
I just create a war file called test.war and drop it in webapps(of course i set up my own web.xml in webapps/test/web-INF). That works for me I do not mess around with server.xml etc, I do not add any context etc as i read in J2EE book. Am I doing someting wrong that may not work in a standard Tomcat application.
Ravi Goli
Ranch Hand

Joined: Feb 13, 2005
Posts: 31
Hey Ben,

That worked for me. I did put a new context tag in the location you said.
I've gone thru your links, they are really helpful.
but i did gave a try i can. I think every starter should go thru the link.

Thanks,
Ravi.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Glad it's working for you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to configure the a web application directory as the root directory