INTRODUCTION TO JSP NN
INTRODUCTION TO JSP NN
INTRODUCTION
DECLARATION TAGS:
It is used to declare variables.
SYNTAX:
<%! Dec Var %>
EXAMPLE:
<%! Int var=10; %>
JSP TAGS
JAVA SCRIPLETS:
It allows us to add any number of JAVA code , variables and expressions.
SYNTAX:
<% Java code %>
JSP TAGS
JAVA COMMENTS:
It contains the text that is added for information which has to be ignored.
SYNTAX:
<% -- JSP comments --%>
JSP TAGS
JSP EXPRESSION:
It evaluates and convert the expression to a string.
SYNTAX:
<%= expression =%>
EXAMPLE:
<% num1 = num1+num2 %>
ADVANTAGES AND DISADVANTAGES
OF USING JSP
ADVANTAGES OF JSP
It does not require advanced knowledge of JAVA
It is capable of handling exceptions
Easy to use and learn
It can tags which are easy to use and understand
It is suitable for both JAVA and non JAVA programmer
DISADVANTAGES OF JSP
Difficult to debug for errors
First time access leads to wastage of time
It’s output is HTML which lacks features
EXAMPLE
Demo.jsp
<html>
<head>
<title>HELLO WORLD</title>
</head>
<body>
<%= “HELLO WORLD” %>
</body>
</html>
THANK YOU