• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer
  • Core Java
  • Design Patterns
  • JSP
  • Servlets
  • Building Tools
  • jQuery
  • Spring
  • Hibernate
  • Mongo DB
  • More
    • HTML
    • SCJP
    • AJAX
    • UML
    • Struts
    • J2EE
    • Testing
    • Angular JS

J2EE Reference

  • Home
  • About Us
    • Java Learning Centers
  • Contact Us

What is JavaServer Pages (JSP)?

April 18, 2017 By j2eereference Leave a Comment

What is JavaServer Pages?

JavaServer Pages was launched by Sun Microsystems in the year 1999. JavaServer Pages is called as JSP in short. JSP is an expedient technology that enables the developers to build dynamic web pages. Generally, stand alone Java code is embedded within static HTML page to form JSP. Additional JSP tags will be used to specialise the functionality of a web page. Rather than HTML, JSP pages can also be formed from XML or other document types. JSP files can be deployed and executed with the help of a web server like tomcat.

Why to use JSP?

  • JSP provides significantly enhanced performance since JSP embeds dynamic elements within HTML Pages itself

  • JSP files will always be compiled before it is being handled by the server for further processing

  • JSP are constructed over Java Servlets and they are translated into servlets during execution. Thus, JSP gets access to all the predominant API’s of Enterprise Java, together with EJB, JDBC, JAXP, JNDI, and much more

  • Simple applications can have only JSP pages. Complex applications can have JSP as part of MVC (Model View Controller). In MVC Architecture, JSP acts as a View Component wherein JavaBeans will play the role of a Model and Servlets will be the Controller

  • Most importantly, JSP is a vital portion of J2EE, a complete environment for building enterprise applications. This indicates that JSP can be used in diverse applications ranging from simple straightforward applications to the most complicated and demanding

Sample JSP Page

Here is a simple JSP Page that displays “Have a Great Day” ten times:

J2EEReference.com Sample JSP Page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>J2EEReference.com Sample JSP Page</title>
</head>
<body>
 
<h1> Sample JSP Page from J2EEReference.com</h1>
 
<% for(int index=0;index<10;index++){ %>
<h5> Have a Great Day!</h5>
<%}%>
 
</body>
</html>

Output of the above program is:

J2EEREFERENCE.COM JSP OUTPUT

Related Posts

  • Differences between Point to Point Messaging Model and Publish Subscribe Messaging Model
  • Point to Point Messaging Model Architecture
  • Publish Subscribe Messaging Model Architecture
  • How JMS is different from RPC?
  • Different types of messages available in JMS API
  • Advantages of Java Message Service (JMS)
  • Java Message Service and JMS Programming Model
  • Java EE or J2EE Architecture
  • JSP Page Directives
  • JSP FAQ

Filed Under: J2EE, JSP Tagged With: JavaServer Pages, JSP

Reader Interactions

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

FOLLOW US ONLINE

  • View J2eereference-166104970118637’s profile on Facebook
  • View j2eereference’s profile on Twitter
  • View j2eereference’s profile on LinkedIn

Subscribe by email

Recent posts

  • Java Buzzwords
  • Anonymous Inner Class in Java
  • Network Programming – java.net Package
  • Java Regular Expressions
  • Method Local Inner Class in Java
  • URL Processing in Java
  • Iterator Design Pattern Implementation using Java
  • Strategy Design Pattern Implementation using Java
  • Decorator Design Pattern
  • Adapter Design Pattern Implementation using Java
  • JSF Composite Components
  • JSF UI Components
  • What is JavaServer Faces (JSF)?
  • GOF Design Patterns
  • History and Need for Design Patterns

Footer

Core Java
Design Patterns
JSP
Servlets
HTML
Building Tools
AJAX
SCJP
jQuery
Testing
Spring
UML
Struts
Java Centers
Java Training
Home
About Us
Contact Us
Copyright © j2eereference.com. All right reserved.