The code that is setting behind the click of a button gets executed. In your case, it could be a form submit which means that all the data that the user has inputted is sent to the server which is serving your jsp page.
I would recommend you reading through the Head First Servlets & JSP book.
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!