JSP stands for Java Server Pages, which creates dynamic web pages by inserting JAVA code into HTML code
It's a web application program. When JSP runs, it is converted to a Java servlet and runs on the web application server.
Perform the necessary functions and respond to the client with the web page with the generated data.

The following is the basic structure of JSP. 

 There are two models in JSP: model 1 and model2, and the structures are slightly different.

Source : dotnettutorials.net
Source : dotnettutorials.net

To configure JSP, we will download the free source, Apache Tomcat. Please refer to the link below to download it.

Apache Tomcat® - Welcome!

 

Apache Tomcat® - Welcome!

The Apache Tomcat® software is an open source implementation of the Jakarta Servlet, Jakarta Server Pages, Jakarta Expression Language, Jakarta WebSocket, Jakarta Annotations and Jakarta Authentication specifications. These specifications are part of the

tomcat.apache.org

Other than Apache Tomcat, there is another free source called Jetty by Eclipse Foundation. 

If you want to download Jetty instead, please click the link below. 

https://www.eclipse.org/jetty/

 

Eclipse Jetty | The Eclipse Foundation

The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 415 open source projects, including runtimes, tools and frameworks.

www.eclipse.org

Once downloaded, Apache Tomcat has to be stopped running because Eclipse has to dominate the control. 

First, create a dynamic web project and name it jspproject

Next, create a new JSP file in the WebContent folder. Since they all have different usages, it is important to save the file in the WebContent folder, not in META-INF or WEB-INF.

JSP file will be looking like this:

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
My first JSP program
</body>
</html>

 

In the next post, we will discuss JSP's main tags, so don't worry if you can't understand the syntax above!

'Java > JSP' 카테고리의 다른 글

JSP) Implicit Objects 1 - Request Object  (0) 2022.08.26
JSP) Scopes - Basics / Application  (0) 2022.08.26
JSP) Comment  (0) 2022.08.26
JSP) Importing / Classes  (0) 2022.08.25
JSP Tags  (0) 2022.08.25

+ Recent posts