Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Root Context - mywebapps has no effect

 
Stephen Batsas
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
 
indira mandapati
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
 
Gaja Venkat
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic