0% found this document useful (0 votes)
24 views2 pages

Introduction to Java Server Pages (JSP)

Java Server Pages (JSP) is a server-side technology for creating dynamic web applications using Java. It allows access to Java APIs, including JDBC for database interaction. JSP includes scriptlets for embedding Java code and declarations for defining variables and methods to be used within the JSP file.

Uploaded by

deepika.s
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Introduction to Java Server Pages (JSP)

Java Server Pages (JSP) is a server-side technology for creating dynamic web applications using Java. It allows access to Java APIs, including JDBC for database interaction. JSP includes scriptlets for embedding Java code and declarations for defining variables and methods to be used within the JSP file.

Uploaded by

deepika.s
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Java Server Pages (JSP)

 Java Server Pages (JSP) is a server-side programming


technology that enables the creation of dynamic, platform-
independent method for building Web-based applications.

 JSP have access to the entire family of Java APIs, including the
JDBC API to access enterprise databases.

Elements of JSP

The Scriptlet

 A scriptlet can contain any number of JAVA language


statements, variable or method declarations, or expressions that
are valid in the page scripting language.

syntax of Scriptlet

<% code fragment %>


Example:
<html>
<head><title>Hello World</title></head>
<body>
Hello World!<br/>
<%
[Link]("Your IP address is " + [Link]());
%>
</body>
</html>
JSP Declarations

 A declaration declares one or more variables or methods that


you can use in Java code later in the JSP file.
 You must declare the variable or method before you use it in
the JSP file.

Syntax for JSP Declarations

<%! declaration; [ declaration; ]+ ... %>

Example for JSP Declarations −


<%! int i = 0; %>
<%! int a, b, c; %>
<%! Circle a = new Circle(2.0); %>

You might also like