servlet for username and password check

Hello. I wish to create a servlet which checks if the entered username and password are correct.If yes..message hello else go back to page showing error message.

I know the settings for tomcat. i know the basic code for servlet.I also know i need http servlet .I will be using html code. I am unsure about the html can anybody help me to read entered values for username and password.(input type=text name=username...what further?