본문 바로가기
공부/JSP

[JSP] 쉽게 배우는 JSP 웹 프로그래밍 2장 연습문제

by thegreatjy 2020. 9. 25.
728x90

4번

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Scripting Tag</title>
</head>
<body>
    <%!
    String str="Hello, Java Server Pages";
    public String getString(){
        return str;}
    %>
    <%= getString() %>
 
</body>
</html>
cs

 

5번

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Scripting Tag</title>
</head>
<body>
    <p>
    Today : 
    <%
    java.util.Date d=new java.util.Date();
    out.println(d);
    %>
    </p>
</body>
</html>
cs

 

6번

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<%@ 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>
    Current Time : 
    <%=
    java.util.Calendar.getInstance().getTime()
    %>
    
 
</body>
</html>
cs

 

7번

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Welcome</title>
</head>
 
<!-- 합쳐지고 최소화된 최신 CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
 
<body>
 
    <nav class="navbar navbar-expand navbar-dark bg-dark">
      <div class = "container">
      <div class = "navbar-header">
      <a class = "navbar-brand" href="./welcome.jsp">Home</a></div></div>
    </nav>
 
<%!
    String str1="도서 웹 쇼핑몰";
    String str2="Welcome to Book Market!";
%>
 
<div class="jumbotron">
  <div class="container">
  <h1 class = "display-3">
    <%= str1 %>
    </h1>
  </div>
</div>
 
<div class="container">
  <div class="text-center">
    <p>
    <%= str2 %>
    <p>
    <hr>
  </div>
</div>
 
    <footer class="container">
    <p> &copy; BookMarket</p>
    </footer>
 
</body>
</html>
 
cs

 

잘못된 것은 댓글로 알려주세요!

쉽게 배우는 JSP 웹 프로그래밍 2장 연습문제

728x90