JSP – JavaServer Pages
JavaServer Pages (JSP) technology used create web content that has both static and dynamic component.JSP is extension of Java Servlet technology.JSP technology makes available all the dynamic capabilities of Java Servlet technology but provides a more natural approach to create static content.The main features of JSP technology are given below:
- A language for developing JSP pages, which are text-based document that are describe how to process a request and construct a response.
- Mechanism for defining extensions to the JSP language.
- An expression language for accessing server side object
What is JSP page ?
A JSP page is a text based document that contains two types of text.
- static data – which can be express in any text based formats like HTML, SVG, XML, WML .
- JSP elements - which constructs dynamic content.
File Extension
File extension for the source file of JSP page is .jsp . The page can be composed of top file that includes other files that contains either a complete JSP page or a fragment of JSP page. The recommended File extension for source file of fragmented JSP page is .jspf .
Simple JSP page
hello-world.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!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=ISO-8859-1"> <title>Java Tutorials Corner - Hello World JSP</title> </head> <body> <h2>Java Tutorials Corner - Hello World JSP</h2> <%out.print("Welcome to Java Tutorials Corner"); %> </body> </html>
This simple JSP page. I will explain about tags used in this page, project structure, and how to run the application in up coming chapter.
Output
0 comments:
Post a Comment