How JSP works? The below is the process:
1. The Web browser sends a request to your web server asking for a page.
2. The Web server loads the page and looks for JSP code to run.
3. If JSP code is found, the web server runs the code and sends the results to the Web browser. So the result page on the client side looks like a pure HTML page.
You may wonder why we need an JSP page to display web contents while we have HTML. Well, HTML can be used to display web contents, but the page is static, not dynamic. Image you have a website that sells products, and you want to display the name, price, description and category of each product on a page. Normally in HTML you would have to write this page out by hand, and every time you change products or prices you would have to go back and re-write the page. But if you use JSP, you can select records from a database and generate the HTML page when an user request it. When you get a new product or change the prices you will only have to change the information in the database and the page will automatically be updated to reflect those changes without writing a single line of code.