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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to configure context.xml in tomcat/config

 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I am using Tomcat 5.5.9

To get this code working in servlet for cross-context communication

ServletContext currentContext = getServletContext();
ServletContext futureContext = currentContext.getContext("/TestOne");

am supposed to make certain configuration changes in tomcat
Refer: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

And this is what I did in context.xml

<Context path="/SessionExample" docBase="E:\tomcat\webapps\SessionExample"
crossContext="true" debug="0" reloadable="true" privileged="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>

<Context path="/TestOne" docBase="E:\tomcat\webapps\TestOne"
crossContext="true" debug="0" reloadable="true" privileged="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>


where SessionExample is current context and TestOne is my second context.

But I am getting error when I startup tomcat server.

SEVERE: Parse error in default web.xml
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Duplicate of:
https://coderanch.com/t/85508/Tomcat/configure-context-xml-tomcat-config

The Tomcat forum was the right place for this question.
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    Bookmark Topic Watch Topic
  • New Topic