• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

just a simple question

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
bernd pier
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Balaji's suggestion ought to have worked... Just asking, but did you restart Tomcat after changing server.xml?
 
bernd pier
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jucheee,
i`ve found my mistake. i was simply to stupid, but now it works.
what a wonderful day
bernd
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic