File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Root Context - mywebapps has no effect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Root Context - mywebapps has no effect" Watch "Root Context - mywebapps has no effect" New topic
Author

Root Context - mywebapps has no effect

Stephen Batsas
Ranch Hand

Joined: Jan 22, 2002
Posts: 117
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

Joined: Feb 15, 2002
Posts: 14
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

Joined: Aug 10, 2001
Posts: 50
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

Joined: Jan 22, 2002
Posts: 117
Thanks Guys
Thats Great
Stephen Batsas
SCPJ2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Root Context - mywebapps has no effect