Servlets are the main component for handling server side logic in Java and the new 3.0 specification introduces some very…