What is JSP?

  • Java Server Pages (JSP) is a technology which is used to develop web pages by inserting java code into the HTML pages by making special JSP tags. The JSP tags which allow java code to be included into it are <% ----java code----%>.

  • It can consist of either HTML or XML (combination of both is also possible) with JSP actions and commands.

  • It can be used as HTML page, which can be used in forms and registration pages with the dynamic content into it.

  • Dynamic content includes some fields like dropdown, checkboxes, etc. whose value will be fetched from the database.

  • This can also be used to access JavaBeans objects.

  • We can share information across pages using request and response objects.

  • JSP can be used for separation of the view layer with the business logic in the web application.

Here is what we cover in the Course


1. JSP Life Cycle

2. Install JSP with Jboss Server & Java

3. JSP Elements - JSP Declaration, JSP Syntax, JSP Expression, JSP Comments

4. JSP Directives: Page Include & Taglib Complete Tutorial

5. JSP Implicit Objects: Complete Tutorial

6. Jsp Action Tags: useBean, include, forward

7. JSP Expression Language (EL)

8. JSP Exception Handling - Checked Exception, Runtime Exception, Errors Exception

9. JSP MVC

10. JSP Tag Library - JSTL Core & JSP Custom Tags

11. JSP Client Request, Server Response & HTTP Status Codes

12. JSP Cookies Handling with Example

13. JSP Form Processing Using getParameter()

14. JSP Filter Mapping in Web.xml

15. JSP Current Date and Time

16. JSP database connection

17. JSP Program Examples: Registration & Login Form

18. JSP Program Examples: File Upload and Download

19. Debug JSP Using Java Logger, Println statements & Debugging tools

Why use JSP?

  • In Java server pages JSP, the execution is much faster compared to other dynamic languages.

  • It is much better than Common Gateway Interface (CGI).

  • Java server pages JSP are always compiled before its processed by the server as it reduces the effort of the server to create process.

  • Java server pages JSP are built over Java Servlets API. Hence, it has access to all Java APIs, even it has access to JNDI, JDBC EJB and other components of java.

  • JSP are used in MVC architecture (which will be covered in MVC architecture topic) as view layer.

  • The request is processed by a view layer which is JSP and then to servlet layer which is java servlet and then finally to a model layer class which interacts with the database.

  • JSP is an important part of Java EE, which is a platform for enterprise level applications.

Advantages of JSP

  • The advantage of JSP is that the programming language used is JAVA, which is a dynamic language and easily portable to other operating systems.

  • It is very much convenient to modify the regular HTML. We can write the servlet code into the JSP.

  • It is only intended for simple inclusions which can use form data and make connections.

  • JSP can also include the database connections into it. It can contain all type of java objects.

  • It is very easy to maintain

  • Performance and scalability of JSP are very good because JSP allows embedding of dynamic elements in HTML pages.

  • As it is built on Java technology, hence it is platform independent and not depending on any operating systems.

  • Also, it includes the feature of multithreading of java into it.

  • We can also make use of exception handling of java into JSP.

  • It enables to separate presentation layer with the business logic layer in the web application.

  • It is easy for developers to show as well as process the information.