This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It is not recommended to override the init(-) lifecycle method rather than you initialise your jdbc objects in init() method which is not life cycle and internally called by init(-).though you can use init(-) in your servlet program it is not recommended and also not industry standard..init() is not lifecycle method but is the convenience method given to programmer to place programmer choice initialization logics by overriding the iniit(-).
Servlet container doesn't call init() directly for instantaiation event.it is internally called by init(-).. if you verify the source code you can easily understand the various scenarios..
give the url patter of your servlet class.use relative url than using absolute url.. moreover please see that there are no spelling mistakes.. it is localhost not locahost.please also see that the deployment directory structure is correct before you run your applicaton.. your servlet program should reside in classes folder and html program inside web root folder parallel to WEB-INF. you get 404 status code when your deployment directory structure is wrong or when you give wrong url pattern at browser window.. please check it once.