This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes just a simple question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "just a simple question" Watch "just a simple question" New topic
Author

just a simple question

bernd pier
Ranch Hand

Joined: Jun 21, 2002
Posts: 30
hey folks,
i`m using tomcat 4.0 j2sdk1.4.0 and suse 7.3.i have created a new directory under /root/tomcat/webapps(=TOMCAT_HOME) that looks like this: /bernd/WEB-INF/classes. i`ve done this, because i want to seperate my servlets from the others.
when i wanna run a servlet by calling http://localhost/bernd/servlet/servletname it won`t work, although when i call it from the old place http://blabla/examples/servlet/servletname it`s still going.
the old path is TOMCAT_HOME/examples/WEB-INF/classes.
i know, one solution is: let the servlet in the old place, but i want to understand the problem.
could anybody help me please
bernd
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Because u have configured ur tomcat to understand whats under bernd directory
for this u need check conf/server.xml and see how to add new context
for example like this.
<Context path="/bernd"
docBase="webapps/examples"
crossContext="false"
debug="0"
reloadable="true" >
</Context>
after this u try http://local/bernd/servlet/servletname


Spritle Software Blogs
bernd pier
Ranch Hand

Joined: Jun 21, 2002
Posts: 30
Hey Balaji,
i`ve changed the server.xml file, also i`ve configured the web.xml file. it won`t work.
i`ve tried a few, copyed the files into different directory`s and changed the server.xml, nothing.
then i read in an article from Kishore Dandu on this page from 5.07 that i can run a servlet by calling it like this: http://localhost/servlet/servletname.
i tried this, it doesn`t work even with old proofed servlets.
i keep on wondering
bernd
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Balaji's suggestion ought to have worked... Just asking, but did you restart Tomcat after changing server.xml?
bernd pier
Ranch Hand

Joined: Jun 21, 2002
Posts: 30
hey anthony,
oh yes i`ve restarted tomcat every time i changed server.xml.i guess it`s a little mistake, but i cann`t see it.
i have changed my server.xml just like Balaji wrote.
then i tried some different ways for example, i`ve changed docBase="webapps/bernd" or crossContext="true", always the same error (http status 404).
my directory tree is:
/root/tomcat/webapps/examples/....
/root/tomcat/webapps/bernd/....
i have declared the servlet in the web.xml.
:roll:
what have i done wrong?
bernd
bernd pier
Ranch Hand

Joined: Jun 21, 2002
Posts: 30
jucheee,
i`ve found my mistake. i was simply to stupid, but now it works.
what a wonderful day
bernd
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: just a simple question
 
Similar Threads
deploying a servlet in tomcat 4.1.30
Error loading file
How can I deploy and test a servlet in tomcat 4.1.30
Configuring Tomcat with IIS 5.0 (very Urgent)
problem with running servlets using tomcat3.2.4