you can call the servlet in this way also..
but iam not getting what exactly you are asking for in line no 3&4

Lets say i have a link dog and cat.
When I click dog that a servlet is invoked and it look in database for the detail about dog and show the user.
and When I click cat it should do the same but the paramater should be cat instead of dog during lookup.
So how can I achieve this. How servlet will know I clicked dog or cat??