Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ravi Goli
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just did this for an app called SimpleMVC by adding a Context node within the Host node of server.xml

 
Raj Puri
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic