Wednesday 28 September 2016

Something about JSP(Java Server Pages)

By,
Sagar

JSP is a server-side technology, JSP is an extension to the Java servlet technology that was developed by Sun.
JSP Stands for Java Server Pages. Java server Pages is not only cross-plat form and cross-Web-Sever support, but effectively melds the power of server-side Java technology with the WISIWYG features of static HTML Pages.
A JSP(Java Server Pages) page is a text document that contains two types of text in it which is: static data, which can be expressed in any of the text-based format (For eg. HTML(Hyper text Markup Language), SVG( Scalable Vector Graphics), WML(Wireless Markup Language), and XML(eXtensible Markup Language)), and JSP elements, which construct dynamic content
JSP technology allows you to easily create Web content that has both static and dynamic components. We can use all the HTML tags in JSP

Some Feature of JSP(Java Server Pages)
1.Separation of static from dynamic content:
In JSP, the logic to generate the dynamic content is kept separate from the static preparation templates by encapsulating it external JavaBeans components. These are then used by the JSP page using special tags and scriptlets. When a designer makes any changes to the preparation template, the JSP page is automatically recompiled and reloaded in the web server by the JSP engine.

2. Write Once Run Anywhere :
JSP pages can be moved easily across platforms, and across web servers, without any changes.

3. Web Server Support:
With Apache, many other popular web servers like Netscape, and Microsoft IIS can also be easily enabled with JSP.

4. Platform Independent:
Runs on all Java-enabled platforms.

5. Scripting :
It uses a Java Java Programming Language or it also uses JavaScript.

6. Database Access:
As you know Java programming language uses JDBC for data access JSP also uses JDBC for its data access.

7. Customizable Table:
JSP is extensible with custom tag libraries.

Example:
<%@ page language=”java”%>                                     <%--JSP page directive--%>
<html>
<body>
Hello!..<br>                                                                   <%--displaying message through html--%>
<%                                                                              <%--Start of JSP Scritplet--%>
out.print(“First program using JSP!!!<br>”);                <%--displaying message through jsp--%>
%>                                                                              <%--End of JSP Scriptlet--%>
</body>
</html>


Output of the above program is:
Hello!..
First program using JSP!!!

No comments:

Post a Comment