My web.xml looks like:
I don't know whether I get you right ! With my limited knowledge I think in-order to implement security the content to be secured is declared using one or more web-resource-collection elements. Each web-resource-collection element contains an optional series of url-pattern elements followed by an optional series of http-method elements. The url-pattern element value specifies a URL pattern against which a request URL must match for the request to correspond to an attempt to access secured content. The http-method element value specifies a type of HTTP request to allow.
Secure Content
/restricted/*
AuthorizedUser
NONE
BASIC
The Restricted Zone
The role required to access restricted content
AuthorizedUser
URL lying under the web application's /restricted path requires an AuthorizedUser role.