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.
The mechanism of the Web application is summarized below. 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.
The programming languages and flows that we have learned for Web application development are as follows. 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. The database creates tables (like an Excel sheet), and each table stores a series of related data such as "ID", "name", and "age". 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>
<html>
<head>
<meta charset=UTF-8>
<title>top page</title>
<link rel="stylesheet" href="@{/css/stylesheet.css}" type="text/css">
</head>
<body>
<h1>Heading</h1>
<p>Text</p>
</body>
</html>
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;
}
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.
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.
This time, we have summarized the terms necessary for handling Servlet / JSP. Next time I would like to delve into each one.
Recommended Posts