• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set default "Context Root" for all urls in the webapp?

 
Srini Venkata
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I recently started working in a project where tomcat is being used.

=============
and under tomcat/conf/Catalina/localhost directory there is a myContext.xml file which had

<Context docBase="xxxxx/tomcat/webapps/myContext" path="/myContext"></Context>

----------
and in the same tomcat/conf/Catalina/localhost directory there is a ROOT.xml file which had
<Context docBase="acuscreen" path="">
-----
I believe now, that the myContext.xml file is never used but only ROOT.xml file is used and because path="", no context path was ever used in the urls.
==============


and all urls inside the application did not have the "context path" in them.

On my local development server, i installed tomcat and i have used myContext as my context root and it is in server.xml as

<Context docBase="myContext" path="/myContext" reloadable="true" source="org.eclipse.jst.j2ee.server:myContext"/>

and because none of the urls in the application have "context path" in them, iam getting "The requested resource (/xxx.do) is not available."

I believe that if i add context path to that url it would work, but is there a way that i can direct requests from all urls via this default context path without actually appending the context path to those urls in the code.

If it helps,Struts 1.2 is used.

Thanks much.

------------------

I could figure out now that if i changed the path="" in server.xml file on my local system, no context path would be needed and so no need to change the urls in the existing application.

Thanks

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should be posted in a servlet or tomcat forum since it's not directly related to Struts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic