Aim: Write a JSP program to print “Hello World” on client machine.
Softeware used: netbean , egde
Coding:
<%@page
contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE
html>
<html>
<head>
<meta
http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<title>welcome</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
Output :
Theory:
JSP stands for java server pages.
it is web based technology that is used to develop dynamic web sites. In this jsp tags are used to insert java code into html pages. A jsp page consist of html tags and jsp tags. it is an advanced version of servlet technology.
A JSP page is a text document. It contains two types of text first is static content and other is dynamic content. Static content can be expressed in any text-based format like HTML. Whereas, the dynamic content comprises of the Java code. JSP technology combines the static content with the Java code. The file extension for the source file of a JSP page is .jsp .
Advantages of JSP over servlet
- They are easy to maintain
- JSP provide an easier way to code dynamic web ages
- JSP does not retrieve additional files like java class files, web.xml files etc.
- Any change in the JSP code is handled by web container (like tomcat)no recompilation or redeployment is required
- JSP has access to entire API of JAVA
Features of JSP
- coding in JSP is easy
- Interactive web pages
The building of dynamic web pages that are able to interact with the users in a real-time environment.
- Easy connection to a database
It allows us an easy connection to the database as it mainly connects with the server.
- No recompilation and redeployment
It is dynamic, secure and platform independent.
0 Comments
if you have any problem, please let me know