Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Root Context - mywebapps has no effect

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,
After changing context path in server.xml - has no effect. I still need to include it in the path. Note that webapp1 is in the webapps dir.
ie. c:\Tomcat4\webapps\webapp1
// Excerpt from server.xml
<!-- Tomcat Root Context -->
<!--
<Context path="/webapp1" docBase="webapp1" debug="0" reloadable ="true" />
-->
Do I have to uncomment the above? Ive tried it still has no effect.
I would like to access my apps by:
http://localhost/jsp-file where jsp-file sits in the webapp1 directory.
Can anyone advise?
Regards
Stephen Batsas
SCPJ2
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)<Context path="/webapp1" docBase="webapp1" debug="0"
reloadable="true" crossContext="true">
place the above tag in web.xml inbetween as shown below
<!-- Tomcat Root Context -->
<Context path="" docBase="ROOT" debug="0"/>
<!--

-->
<!-- Tomcat Manager Context -->
<Context path="/manager" docBase="manager"
debug="0" privileged="true"/>

<!-- Tomcat Examples Context -->
<Context path="/webapp1" docBase="webapp1" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>------------------------
2)if it is done properly you have to call your jsp
stop and restart server again then call
http:/localhost:8080/webapp1/file.jsp
3)if you are doing on windows98 some times it will not work .I don't know why.
but on winNT it will work perfectly
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The following statements are not clear to me


After changing context path in server.xml - has no effect. I still need to include it in the path.


However I have explained below the addition of a new context to server.xml:
To add a context for c:\Tomcat4\webapps\webapp1, you have to add the following in server.xml at the appropriate place.
<Context path="/webapp1" docBase="webapp1" debug="0" reloadable="true">
</Context>
Then restart/start tomcat server and access the files in webapp1 using "/webapp1" prefix. That is, to access a file say, send.jsp, use [URL=http://localhost:no/webapp1/send.jsp, where no is the port number to which tomcat server has been configured to listen.
Hope this helps.
Gaja Venkat
--------------------------------------------
Sun Certified Programmer for Java 2 Platform
[ March 19, 2002: Message edited by: Gaja Venkat ]
 
Stephen Batsas
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys
Thats Great
Stephen Batsas
SCPJ2
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic