• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

place of servlets

 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The orion server has this *.xml file containing:


<orion-web-app
deployment-version="1.4.5"
jsp-cache-directory="./persistence"
temporary-directory="./temp"
servlet-webdir="/servlet/"
>


meaning that you can put all your servelets in the classes directory of e.g. the default application, finished.
A form parameter then looks like


<form name="form" method="post" action="/servlet/VideoLoginServlet">


you do not have to tell (in a web.xml) for each servlet where it lives or in a *.war or deployment tool.
How to do the 'analogue' with TOMCAT?
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter:
I think you answered your own question...you said that you're looking for a default web application and you don't want do define each servlet in web.xml.
First there is a default web application - ROOT under webapps folder in tomcat. Any servlet class files you dump under \webapps\ROOT\WEB-INF\classes can be referred to, just as you said /servlet/HelloWorldServlet for example. If it's a package'd servlet class you refer to it as /servlet/packagename.HelloWorldServlet.
Point being , for the default ROOT web application all you need is a / in your URI (URL) leading to your servlet via the invoker servlet.
Second:
You don't need to have any servlet element(s) in your web.xml. It's completely optional, unless you want to create alias, parameters etc.
Hope this helped
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Madan,
I got this advice too at the cattle-drive.
The JDBC-assignment is running fine using the orion-server, where the classes are indeed in the directory correspondent what you said.
Copying my 'greetings' file to ROOT, works.
(creating WEB-INF/classes/) and copying the Servlet-class-files (called by /servlet/"serveletname") gives a fine errormessage:
The requested resource is not available.

This is/was the reason of my question.
So tomcat somewhere 'must' be told that the servelets in "tomcat"/webabs/ROOT/WEB-INF/classes/*.class
should be found e.g. from a WELCOME.HTML


<form name="form" method="post" action="/servlet/VideoLoginServlet">
Password:<br>
<input type="password" name="password" value="">
<input type="submit" value="Login">
</form>


I have not found it yet.
By the way, I am talking about tomcat gotton by installing jwsdp-1_0_01.
 
Madan, Gopal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter:
I also run the same thing from jwsdp_1_0_01, along with standalone tomcat 4.0.1
while your server is running, did you try this URL
http://localhost:8080/manager/list
If the output from this URL says that the ROOT webapp is running, then you should be able to acces your servlets.
Do post back whether your ROOT app was running or not.
Thanks
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done, ROOT is running but did not what we/I expect.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic