2. ● For creating our first JSP the meanings of
programation are the minimum we must
have.
● 1. The first thing we have to know is that
each JSP page is going to generate us a
HTML page. That's why we have to have a
HTML page created that includes Java
codes and it produces our JSP program.
3. 2. It's important to keep in mind that our JSP
document is a HTML page with its own
structure where it is mixed together with the
Java code.
3. When we want to introduce Java code we
will make it with <% and %> symbols.
4. ● In this part you will find
an example of the codes
that are necessary for a
JSP program.
6. 4. For introducing some Java content in the
page we will use the following function:
<% out.println("Text to put on the page "); %>
7. 5. Even if it has no more Java code, we can
replace it with the next code:
<%= "Text to put on the page" %>
6. Finally we must know that for saving any
file we use ''.jsp'' label.
8. Another example of JSP.
● The second example is going to be called:
prog1.jsp:
%
int base=0,altura=0; double area=0;
if(request.getParameter("OK") != null)
{
12. And the third one.
First program of adding two numbers in JSP:
<%@ page language="java"%>
<html>
<head>
<title>Add number program in JSP</title> </head>
<body>
<% int a=5; int b=2;
int result=a+b;