This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes 2 context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "2 context" Watch "2 context" New topic

2 context

zheng yu

Joined: Apr 25, 2001
Posts: 28
Tomcat 3.2.1 + linux 6.2
I have installed Tomcat and it works fine . Today i add 2 similar context to server.xml ( say one is cweb , the other is sytlib ) .
And i copy the same servlet class file to its directory( .../WEB-INF/classes/) , then i update my servlet source .( say change background color form white to blue ) ,and i only copy the new class to cweb context . that means old class under sytlib context is not overwritten .
Then i input some url to test my servlet .when i input "http://..../cweb/servlet/Calendar" , it seems ok , background is blue . but when i input "http://.../sytlib/servlet/Calendar" , its background become blue too .
I dont know why , can anyone give me explannation ?

Thanx in advance
zheng yu

Joined: Apr 25, 2001
Posts: 28

I have solved this problem . It is caused by my CLASSPATH setting .It always point to my directory where my source code reside ( unfortunately , i first compile the source in local directory , and then use BAT file to copy it to certain context ) ,so All these 2 context use the same class file , actually .

I agree. Here's the link:
subject: 2 context
It's not a secret anymore!