홈페이지 만들어보기
일단 apache tomcat 9 다운로드
인텔리제이에 톰캣 설정하기
https://velog.io/@wlsdud11457/IntelliJ-Apache-tomcat-%EC%97%B0%EB%8F%99-%EB%B0%8F-%EC%84%A4%EC%A0%95
IntelliJ + Apache tomcat 연동 및 설정
IntelliJ(인텔리제이) 다운로드 링크https://www.jetbrains.com/ko-kr/idea/download/?section=windowsApache tomcat(아파치 톰캣) 다운로드 링크 zip 파일로 다운https://tomcat.
velog.io
이후 작성
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<title>JSP - Hello World</title>
</head>
<body>
<h1>화면에 보이는 곳</h1>
<h2>poseidon</h2>
<h6>h6</h6>
<h1>asd</h1>
글자<br>
글자<p></p>
글자<br>
HTML은 HyperText Markup Language<br>
<a href="http://www.naver.com">naver</a><br>
<img alt= "그림이 안 뜰 때 나올 글자" src="./img.jpg"><br>
</body>
</html>
localhost:8080/main.html 페이지 만들어보기
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>404 not found</title>
</head>
<body>
<h1 style="color:palevioletred">MAIN</h1>
메인입니다 <br>
<table border="123">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
</table>
<div>
<form action="./login.jsp">
<input type="text" name = "id" style="font-size:20pt; color:greenyellow">
<input type="password" name = "pw" style="text-align:center">
<button type="submit">로그인</button> <!--id, pw 를 가지고 login.jsp 페이지로 넘어감 -->
<button type="reset">지우기</button>
</form>
</div>
</body>
</html>
login.jsp 페이지 만들기
<%--
Created by IntelliJ IDEA.
User: admin
Date: 2023-12-20
Time: 오후 3:37
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>로그인 결과</title>
</head>
<body>
<% // 여기는 자바 작성 가능
String id = request.getParameter("id");
String pw = request.getParameter("pw");
String result = "불일치";
if (id.equals("poseidon") && pw.equals("01234567")) {
result = "일치";
}
%>
당신이 입력한 ID 는 : <%= id %><br>
당신이 입력한 PW 는 : <%= pw %><br>
결과 : <%=result%> <br>
</body>
</html>
'HTML' 카테고리의 다른 글
240108 (0) | 2024.01.08 |
---|---|
240104 VScode 를 이용하기 (0) | 2024.01.04 |
240102 HTML, Servlet 등 (2) | 2024.01.02 |
231229 HTML (0) | 2023.12.29 |
231228 HTML (1) | 2023.12.28 |