Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Making things work...

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need some help setting things up. Can someone please either explain how- or point me in the direction of some basic, direct documentation that can show me how to (I'm using Tomcat 4.01):
1. Run my application from somewhere other than ..\examples\jsp\..
2. Let me call my application from the browser with a URL that I set- something other than localhost:8080...
3. My beans aren't working and I think it's because I need to change my CLASSPATH. I tried changing it in my autoexec.bat file, but no matter what I do Tomcat always starts up 'Using CLASSPATH: C:\Tomcat\bin\bootstrap.jar;C:\jdk\lib\tools.jar. How can I tell it to look for my classes where I want to put them?
Thank you.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may like to know that the documentation for Tomcat can be downloaded at http://jakarta.apache.org/tomcat/index.html. It will help you a lot in your developing.
In brief the first 2 question refer to the server.xml file this describes Tomcat the server.
1.Run my application from somewhere other than ..\examples\jsp\..
Edit the <tomcatHome>/conf/server.xml file for every new web application you build add the following before the closing </host> tag:

The path refers to the URL ie http://localhost:8080/myApplication. The docbase can be relative or full path to your first page/file (usually index.html/htm/jsp)
2. Let me call my application from the browser with a URL that I set- something other than localhost:8080...
Open the server.xml file as above and search for 8080. Youll soon find the tag containing the port number.
3. My beans aren't working and I think it's because I need to change my CLASSPATH.
Check the documentation, but for a quick fix place any jar files in your <tomcatHome>/lib directory. I believe that the proper way is to have your own lib directory within your docBase (see above)
Hope this helps
 
Saloon Keeper
Posts: 28058
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on whether you're using Tomcat 3 or Catalina (Tomcat 4), the exact set of rules for classpaths is slightly different, but normally beans are going to be part of your specific web app, and that part is the same for all recent Tomcats and J2EE-compliant servers in general.
If your bean is in loose class files, place the classes in WEB-INF/classes. This is automatically added to the app's CLASSPATH. The same rules about directory structure and filename capitialization apply as they would for any Java app.
If the beans are in jars, add the jarfiles to the WEB-INF/lib directory. Each jar will be added to the CLASSPATH for that web app.
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
all you have to do is
create a folder name of your choice inside <tomcat root>/webapps/new folder name
map this folder name side the server.xml file found inside <tomcat root>\conf\server.xml i.e,
add this line
<Context path="/NEW FOLDER NAME" docBase="webapps/NEW FOLDER NAME" crossContext="false" debug="0" reloadable="true"/>
also you have to place folder named WEB-INF inside you new folder and inside web-inf folder place a folder called 'classes' inside classes folder place your servert and beans and helper classes of need for your purpose.
one more thing place web.xml file (you can get this file inside example\web-inf folder). This file is used for your servlet regester.
if you want change the port insted of 8080 your can do by changing the port number in server.xml(replace 8080 found in xml to port of your choice0
also you need not refer with localhost you can call by the ip of your system (like http://ipaddress ortnumber).
regarding classpath simple suggestion would be append to the existing classpath in the command prompt you running which is used to run tomcat. This will not effect another application using classpath set by the systme.
-arun
[ January 25, 2002: Message edited by: arun boraiah ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic