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?
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)
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: 4011
posted
0
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?
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: 421
posted
0
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: 9033
10
posted
0
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: 421
posted
0
I'll try tonight
Peter Gragert
Ranch Hand
Joined: Jan 16, 2001
Posts: 421
posted
0
No (if I did not made an error) did not work because of: Orion has this text in orion-web.xml
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 ]