Where you are facing difficulty ? try to implement something then we will help you.But you need to submit the form from jsp to servlet. In servlet you can write some logic then you can use sendredirect to redirect to jsp. dont forget to make entries in web.xml for your servlet.
You will find many example on internet for the same.