Jsp Introduction

Jsp

It is a server side programming technology which is used for developing web applications. It seperates the presentation layer from business layer.

Presentation Layer like front view-html

Business Layer which containes the business logic like java beans.

It is simple,yet powerful technology for creating and maintaining dynamic content.It was introduced as a follow on technology to servlet. Problem with servlet is that we need to give many print statement to generate HTML view.

Features:

1) Portable: Jsp files can run on any web or application server that provide support for them.

2) Composition: Jsp architecture includes the resuable java component such as Java Beans and servlet.

3) Processing: Jsp contains both Html and jsp scripting tags. Jsp page on call gets transferred into servlet.

Benefits of Using Jsp:

1) It seperates the content and display logic which is easier for developer.

2) It provides reusable component like java beans and custom tags.

3) It recompiles automatically when we change the source code.

Jsp Access Model or Processing:

jsp life cycle

Description:

Browser sends the request which is handled by servlet.

Servlet will act as a controller and will do the processing.

For processing servlet will connect to Java beans for DB processing.

After completing the processing servlet will forward the controll to jsp.

Jsp page will retrieve the servlet object and extract the dynamic and will display the same to user in the browser as a response.