views:

20

answers:

1

I have a web application that is made of a servlet, let's call it myservlet. There are two different pattern matching the same servlet, let's call them /patterna/* and /patternb/*

Assume I want to 1. attach to myservlet a chain of servlet filters, and I want this chain is different in the case I invoke the servlet with patterna and with patternb 2. in the case I invoke patternb, I want to set security for the servlet, in case I invoke patterna, I don't want any security

Is this possible? I understand that probably the limit in my application is that I want to expose the same servlet and distinguish on mappings, rather than expose two different servlets..

+1  A: 

It is allowed to map a servlet twice - i.e. have two <servlet>..</servlet> tags with the same class, but different name (and different mapping). Try it.

Bozho
You can safely leave the "I think" away :)
BalusC