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

i get diffrent contextpath

 
amir taghvayi
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i use tomcat5.32 + cpanel . i get diffrent context path in diffrent folder , for example :

i requested this Link " http://jbean.ir/colors/colrs.jsp " And give Back This Context Path " ContextPath: /colors "

And when i Requested This Link "http://jbean.ir/cal/cal2.jsp " give Back This Context Path " ContextPath : /cal "

Please Help(F1) !!

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each web app has its own context path. If you want two resources to have the same context path they must be in the same web app.
 
amir taghvayi
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Bear Bibeault
all file are Inside a one web app . I was confused why get different context path for different folder.
server.xml is :


<Host name="domain.com" appBase="/home/domain/public_html" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" reloadable="true">
<Alias>www.domain.com</Alias>
<Context path="" reloadable="true" docBase="/home/domain/public_html" debug="1" privileged="true" autoDeploy="true" liveDeploy="true" />
<Context path="/manager" debug="0" privileged="true"
docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
</Context>
</Host>
please help me !
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use code tags when posting code and markup.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to show us how you have the web app laid out on disk.
 
amir taghvayi
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
the structure of project is :



please help me !


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how are you obtaining the context path?
 
Stefan Evans
Bartender
Posts: 1640
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the problem is that you are using the public_html directory as both an appBase for your host, and a docBase for your context.
Tomcat is geting confuzzled by this.

Because it is an app_base directory, and you have autoDeploy="true", any directory that you put in public_html becomes a seperate web application/web context - hence 'cal' and 'colors' show up as contexts.

Quick Solution: Edit server.xml to specify your app_base to be a different folder from the one you are using for your context. I would suggest something like '/home/appBase' to make sure it is well out of the way. Restart Tomcat.

Better Solution: Don't declare contexts in server.xml. The preferred method is described as part of the Tomcat documentation

 
amir taghvayi
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Stefan Evans , is correct .
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic