• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

Introduction

JSP

JSP stands for Java server page. It is based on java programming languages. It is used to develop dynamic web pages. It was developed by Sun Microsystems to allow server side development. JSP files are HTML files with special Tags containing Java source code that provide the dynamic content. JSP provide excellent server side scripting support for creating database driven web applications. JSP allows developers to create wide ranges of web application like ecommerce, banking...etc. It can combine with HTML, XML, Java Servlet and JavaBeans technologies into one highly productive technology which allow web developers to develop reliable, high performance and platform independent web applications. JSP is the technology and whose specification is implemented by server vendors. JSP is an alternative technology for servlet. Since, servlet having the following limitations:-

  • In order to develop any servlet they must know java language.
  • Servlets provides uncomforting. Since, in a single servlet we are writing presentation logic and application or business logic.
  • Maintenance and deployment problems are more (servlet allows only static changes).
  • Servlet does not provide automatic page compilation i.e., every servlet program must be compiled explicitly.
  • Servlet does not provide any custom tag (user defined tag) development.
  • Servlet does not provide any implicit objects.

Advantage of JSP

There are various advantage of JSP given below:-

  • To write any JSP program java language is not necessary i.e., a non-java programmer can write the JSP page effectively.
  • In JSP there is a separation between presentation logic and application or business logic.
  • JSP page can minimize or reduce maintenance and deployment problems. Since, it allows dynamic changes.
  • JSP provides automatic page compilation that means every JSP program internally translated as a java program by the container which is nothing but servlet.
  • JSP provides the features to develop custom tags.
  • Every JSP page contains 'n' number of implicit objects such as out, session, exception... etc.
  • As JSP is based on java so ,it provide platform independent functionality, that means once the program of JSP is written it can be deployed or run on any JSP enabled server. without rewriting the changes.

JSP Phases

Whenever we will write code in a JSP page, that JSP page will undergo the following phases:-

Translation phase:- It is one which converts .jsp program into .java program internally by the container. Once the translation phase is completed the entire JSP program is available into a pure java program.

Compilation phase:- It is one which converts .java program into .class file provided no errors found in .java program by the container. If errors are found by the container in .java program those errors will be listed in the browser.

Running or Execution phase:- It is the process of executing .class file by the container.