• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

just curious: servlet mapping

 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not aware of any risk in not mapping your servlets.
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll try tonight
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have seen it too, thanks, but it did not help.
Indeed I opened questions in "tomcat/apache"
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic