JSP Use JSP where the complexity of the HTML is the most important thing / or where non-programmer HTML authors have to maintain the site. JSP is used to develop the frontend of the applications like data entry forms, reports and query forms.
Servlet Use servlets where computation is the most important thing or where binary content such as images must be generated. Servlet can be used for back-end processing like inserting data into database. Search the database to produce report data.