*
The moose likes Cattle Drive and the fly likes just curious: servlet mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "just curious: servlet mapping" Watch "just curious: servlet mapping" New topic
Author

just curious: servlet mapping

Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
This isn't *directly* related to the assignments...
I've seen elsewhere that it's a good idea to "map" servlets. My very cursory understanding is that it allows the servlet container a surer way to locate the servlets.
I'm curious if any of you doing the servlets assignments do/did this servlet mapping thing?
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
Servlet mapping is to my knowledge a way how a container knows where it can find a class-file.
It is e.g. done in "Tomcat" using XML ... .
And it occures too in web.xml files in the WEB-INF directory of a web aplication (if I am not wrong, I am a beginner too)
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
I haven't used it for any of the Cattle Drive assignments, but I have used it for everything else I have done. Peter's description is pretty accurate for what it does.


Matthew Phillips
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Yeah, in Orion it's web.xml in the WEB-INF directory too. I did it for the first servlets assignment, but let it go for later ones.
What's the risk if you don't map your servlets?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
I am not aware of any risk in not mapping your servlets.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
I think it comes across with the different 'servers'. The orionserver if told where your servlets are, just the way described in the assignments for JDBC works fine. At the moment I am 'struggeling' to do the same for the tomcat server in the jwsdp-package from sun together with the ant-build (make-file by Java) but did not yet succeed with the servlets only the videologin.html becomes accessable now but logging in does not yet work: Servelet not found error ... which means that somehow or other my 'servletmapping' for this application is not yet ok.
By the way 'ant' is GREAT (see above!)! It is too a preparation to the XML-tasks in statu nascendi. Hint to the makers , because here you already have to use 'xml' without sax or ... and you get your 'compilation etc. as a gift' and ever seen the 'power' of make-files ...
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
If the html file is in $TOMCAT_HOME\webapps, then the servlets should be in $TOMCAT_HOME\webapps\WEB-INF\classes
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
I'll try tonight
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
No (if I did not made an error) did not work because of:
Orion has this text in orion-web.xml

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

So, something has to be done where to find servlets which must be done differently in tomcat.
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Dug this up over in the Apache/Tomcat forum, maybe it helps...
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
I have seen it too, thanks, but it did not help.
Indeed I opened questions in "tomcat/apache"
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

If you are using version 4.0.4 or less (not 3.x) or 4.1.x then it is possible to use '/servlet/*' by default, but the later versions it is disabled - read here
To be able to call a servlet, you therefore need to use 'servlet-mapping'
Rene
[ October 31, 2002: Message edited by: Rene Larsen ]

Regards, Rene Larsen
Dropbox Invite
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: just curious: servlet mapping
 
Similar Threads
Servlet containers and static resources
question about selection of Orion
We have password!
Running an Applet in Tomcat 4.0
Websphere unable to parse Web.xml