What is the URL that you are entering in the browser?? You've configured the URL as which means that you'll have to enter this URL in your browser http://localhost:8080/contextPath/New/ShowHeadersServlet/ , then the browser should ask for username and password...