posted 13 years ago
Probably, from maintainability viewpoint, they kept <url-pattern> tag separate from <servlet>. If its a part of <servlet>, imagine what you'd need to do if you later want a url path to be handled by a different servlet (existing or a new one). You'd have to delete the <url-pattern> from the current <servlet> and make a new entry in the other <servlet>. Instead, keeping this tag in a separate <servlet-mapping> tag gives you the ease of maintenance by being able to change just the name of the servlet without touching other parts in the descriptor.