Nothing is necessary. You can write anything you want in any way you want. In the end it is experience that will tell you when it is better to use servlet to handle the request from the jsp file or just just handle it in the same page by setting action in the form tag to be:
<form action="" ....> If you need to use and declare a lot of methods in order to use them then you use servlets. Or in some cases you can have more than one jsp (whose requests have a common behavior) to go in ONE servlet, handle the request, and then depending on the results you can have more than one selections as in which jsp to go next.
If you need to submit a form and then just display the results in the same page, then one jsp that submits to itself is enough.
Reputation Points: 1014
Solved Threads: 446
Nearly a Senior Poster
Online 3,258 posts
since Dec 2007