• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to configure WEBAPP made outside the tomcat home directory structure

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
My tomcat home dir. structure is
E:\jakarta-tomcat-4.1.12

However the project dir. structure is
E:\ramdas
------->WEB-INF
----------->classes
----------->jsp
I am just trying to put one simple servlet into
classes directory and access thr' browser
can somebody help in terms of what all file to configure and the config details
Thanks
Shewag
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To set the document root of your web application at some point other than the $CATALINA_HOME/webapps/ directory you have to add a <context> entry in the CATALINA_HOME/conf/server.xml configuration file.

Tomcat 4.1 how-to webpage here.
 
shewag
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
*************************************************
changed Server.xml conf under the <Host>

<Context path="/ramdas" docBase="E:\ramdas\WEB-INF\" debug="0" reloadable="true" crossContext="true" >
/Context>

The web.xml conf is
?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>Servlet1</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/Servlet1 </url-pattern>
</servlet-mapping>
</web-app>
*************************************************
For accessing on the browser the URL given is
http:\\ramdas\Servlet1\Servlet1
page is not displayed
Cold you please tell where i am going wrong
Thanks
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the context entry, you should set the docbase to: E:\ramdas.
Even if your docbase is not in the tomcat dir structure, your servlets will be served by tomcat, so the url to access your servlets is something like this:
http://localhost:8080/ramdas/Servlet1
(if you have tomcat running in your machine, if you don't, change 'localhost' for the proper address).
 
reply
    Bookmark Topic Watch Topic
  • New Topic