[JAVA] Until you create a Web application with Servlet / JSP (Part 1)


I would like to look back on about a year of studying programming languages (Java). In studying, my goal was to create a web application.

How the web application works

The mechanism of the Web application is summarized below. スクリーンショット 2020-11-02 131507.png Strictly speaking, it's more detailed, but it's roughly made up of this mechanism. In creating the above application server, not only Java but also database (SQL), I learned the technology of Servlet / JSP and HTML / CSS.

Learning language and flow

The programming languages and flows that we have learned for Web application development are as follows. スクリーンショット 2020-10-30 072205.png SQL The first thing I learned was SQL. SQL is a "database language" used to manage and operate databases for handling large amounts of data (user information, product information, videos, etc.). Simply put, it is a statement to the database.

I think that the database (relational database) is similar to Excel as an image. スクリーンショット 2020-10-30 164449.png The database creates tables (like an Excel sheet), and each table stores a series of related data such as "ID", "name", and "age". スクリーンショット 2020-10-30 165441.png There are four main command units. 1, make a table (CREATE) 2, Information retrieval (READ) 3, information input, update (UPDATE) 4, delete information (DELETE) I was able to study crisply because my main focus was on learning simple commands.

As a merit of using a database ・ Data can be automatically associated and analyzed ・ Data can be shared without being damaged even if accessed at the same time. ・ Illegal data can be blocked backed up Etc. can be obtained. Java Next to SQL, I studied the basics of Java while looking at reference books. Java is also used for the Servlet that will be described later in the language required to create a server. I would like to write a detailed article about what I have studied. HTML/CSS I studied HTML and CSS to create screens that I actually see on my PC or smartphone. HTML constitutes sentences, images, and links, and CSS can be regarded as a decoration for HTML.

For example, if you only use the following HTML

<!DOCTYPE html>
<meta charset=UTF-8>
<title>top page</title>
<link rel="stylesheet" href="@{/css/stylesheet.css}" type="text/css">

スクリーンショット 2020-11-02 144023.png It will be displayed while it is written as body as above. Currently only HTML is displayed, so only black characters are displayed, but if you add CSS here

h1 {
	color: red;

p {
	color: blue;

スクリーンショット 2020-11-02 144402.png Changed the letters of h1 (heading) to red and the letters of p (body) to blue. In addition to changing the color of the text, you can color the background, make it an image, and change the place to display it. You will be able to decorate it by moving it to the left or right.

Servlet / JSP

Simply put, you can think of JSP as a screen and Servlet as a server.

JSP is HTML with Java code embedded in it. By URL from the browser Call the Servlet and the Servlet that receives the request uses JSP Create the required screen and return it to your browser.

So why does JSP need to embed Java code in HTML? For example, the same product is not displayed every time on a shopping site. You will see new products and featured products. That is a servlet (server) I found new products released this month in the database, and found Java in JSP This is because the code creates the screen as a list and returns it to the browser.

Next time preview

This time, we have summarized the terms necessary for handling Servlet / JSP. Next time I would like to delve into each one.

Recommended Posts

Until you create a Web application with Servlet / JSP (Part 1)
Create a simple web application with Dropwizard
Create a java web application development environment with docker for mac part2
Web application development memo with MVN, Tomcat, JSP / Servlet with VScode
Build a web application with Javalin
Comparison of WEB application development with Rails and Java Servlet + JSP
Create a memo app with Tomcat + JSP + Servlet + MySQL using Eclipse
Let's make a book management web application with Spring Boot part3
Let's make a book management web application with Spring Boot part2
[Java / Eclipse / Servlet / JSP / PostgreSQL] A WEB application framework with data posting / saving / editing / updating / deleting functions
Basic Web application creation Servlet / JSP (posting screen)
Create a web api server with spring boot
Basic Web application creation Servlet / JSP (logout function)
Create a JAVA WEB application and try OMC APM
Build a WEB system with Spring + Doma + H2DB Part 2
Tutorial to create a blog with Rails for beginners Part 1
The first WEB application with Spring Boot-Making a Pomodoro timer-
Create a Hello World web app with Spring framework + Jetty
Create a playground with Xcode 12
Getting Started with JSP & Servlet
Try developing a containerized Java web application with Eclipse + Codewind
Web application built with docker (1)
Tutorial to create a blog with Rails for beginners Part 2
Tutorial to create a blog with Rails for beginners Part 0
Create a simple DRUD application with Java + SpringBoot + Gradle + thymeleaf (1)
Create a simple web server with the Java standard library com.sun.net.httpserver
[Probably the easiest] WEB application development with Apache Tomcat + Java Servlet
[Introduction to JSP + Servlet] I played with it for a while ♬
Create a Vue3 environment with Docker!
Deploy a Docker application with Greengrass
Java Servlet / JSP Request Scope Part 1
Preparing to create a Rails application
Java Servlet / JSP Request Scope Part 2
Passing parameters from JSP with Servlet
Create a Servlet program in Eclipse
Hello World with GlassFish 5.1 + Servlet + JSP
Web application creation with Nodejs with Docker
Create exceptions with a fluid interface
Create a Maven project with a command
Until you create a local network with CentOS8 and make an ssh or DB connection between locals.
# 1 [Beginner] Create a web application (website) with Eclipse from knowledge 0. "Let's build an environment for creating web applications"
I want to create a dark web SNS with Jakarta EE 8 with Java 11
[Java] Deploy a web application created with Eclipse + Maven + Ontology on Heroku
Create a LINEnews-style tech news summary app with Rails x LineBot! [Part 1]
Volume of trying to create a Java Web application on Windows Server 2016
Getting started with Gradle (until you create a Java project and combine external libraries into one executable JAR)
Getting started with Maven (until you create a Java project and combine external libraries into a single executable JAR)
I want to develop a web application!
Create a web environment quickly using Docker
Create a jar file with the command
[Rails6] Create a new app with Rails [Beginner]
Create a simple on-demand batch with Spring Batch
Create a GUI JSON Viewer with Ruby/GTK3
Create a MySQL environment with Docker from 0-> 1
Create a simple bar chart with MPAndroidChart
Start web application development with Spring Boot
Create a temporary class with new Object () {}
[Introduction to JSP + Servlet] A little animation ♬
[Rails 5] Create a new app with Rails [Beginner]
Role of JSP in Web application [Java]
Run WEB application with Spring Boot + Thymeleaf