• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This should be posted in a servlet or tomcat forum since it's not directly related to Struts.
 
reply
    Bookmark Topic Watch Topic
  • New Topic