We are moved to new domain
Click -> www.ehowtonow.com
Wednesday, 6 November 2013

JSP Introduction


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:
  1. A language for developing JSP pages, which are text-based document that are describe how to process a request and construct a response.
  2. Mechanism for defining extensions to the JSP language.
  3. An expression language for accessing server side object
JSP technology also contains an API that used by developer of web containers.
What is JSP page ?
A JSP page is a text based document that contains two types of text.
  1. static data – which can be express in any text based formats like HTML, SVG, XML, WML .
  2. JSP elements - which constructs dynamic content.
JSP helps developer to insert Java code in HTML page by making use of tags available in JSP.JSP can access all the packages of Java library.
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

hello-worldjsp

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: JSP Introduction Rating: 5 Reviewed By: eHowToNow