Hi Pedro,

> -----Original Message-----
> From: Pedro Nevado [mailto:[EMAIL PROTECTED]
> Sent: jeudi 9 septembre 2004 16:24
> To: [EMAIL PROTECTED]
> Subject: What to put in web.xml or cactus-web.xml, and what not.
> 
> Hi there,
> 
> As a Cactus' beginner, I find      intriguingthingsthatprobablyarenot.
> 
> For instance, in the examples in jakarta-cactus-13-1.6.1\samples\servlet:
> - the test.jsp used to assert a dispatch-forward is referenced in the
> (cactus-)web.xml.
> - the SampleServlet which defines the dispatch is not defined in either of
> the two deployment descriptors.
> 
> However, if we have a look at the example in the JUnit in Action book
> (servlet example of chapter 9), the opposite happens:
> - the securityError.jsp used in a (SecurityFilter) dispatch-forward is not
> included in the deployment descriptors.
> - the AdminServlet is included in the web.xml file. BTW, the
> SecurityFilter
> is not included.
> 
> My question is: does it matter what is included in the deployment
> descriptors?
> 
> This is my guess:
> 
> - test.jsp should be included in the deployment descriptor because it is
> not
> in the context root directory. For the same reason, securityError.jsp
> could
> not be included, because it is in the context root.
> - since the instances of the servlets and filters used in the tests are
> plain Java objects, it is irrelevant if they are included, so AdminServlet
> could be excluded of the web.xml.

This is the Servlet spec and Cactus is abiding by it. In the spec, JSP
resources do not have to be defined in the web.xml file. They can be, which
is useful if you wish to provide a special mapping for JSPs but that's up to
you. OTOH Servlets *must* be present in web.xml so that mappings can be
defined for them (they have no default mappings).

Hope it helps,
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to