Originally posted by Cameron W. McKenzie:
ServletConfig is specific to a given servlet mapping.
For example, you could have one TaxPortlet, but create 52 mappings, one for each state, in the web.xml file. For each state, you put a ServletConfig mapping for the state tax rate. As a result, each servlet mapping is unique - the TaxPortlet mapping for Nevada has a different state tax rate than the one for Florida.
On the other hand, ServletContext is common to all Servlets in a given war, so while each ServletMapping, for each state perhaps, would have a unique value for the state tax rate, EVERY Servlet in the war would share a common federal tax rate.
Hope that didn't make it more confusing.
-Cameron
Correction:
The config object is specific to each servlet
entry.
Init params don't go in the mapping entries.
They go in the servlet entries.
You can do what you've described by having multiple servlet entries, all using the same servlet class, each having it's own servlet meapping.