728x90
반응형
04_01_expression01.jsp
04_01_expression01.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> Today is : <%=new java.util.Date() %><br> 오늘의 정보 : <%=new java.util.Date() %> </body> </html>
05_02_welcome.jsp
bootstrap
05_02_welcome.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.css"> </head> <body> <nav class="navbar navbar-expand navbar-dark bg-dark"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="./04_01_expression02.jsp">Home</a> </div> </div> </nav> <%! String greeting = "Welcome to Web Shopping Mall"; String tagline = "Welcome to web Market!"; %> <div class="jumbotron"> <div class="container"> <h1 class="display-3"><%=greeting %></h1> </div> </div> <div class="container"> <div class="text-center"> <h3><%=tagline %></h3> </div><hr> </div> <footer class="container"> <p>© WebMarket</p> </footer> </body> </html>
06_02_page_import.jsp
<%@ page contentType="text/html; charset=UTF-8"%> <%@ page import="java.util.Date" %> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> Today is <%=new Date() %><br> 오늘은 <%=new Date() %> </body> </html>
06_03_page_errorPage_error.jsp
06_03_page_errorPage.jsp
1. String 값을 null
2. 복제불가
로 에러발생시 import한 jsp 에러페이지가 출력된다.06_03_page_errorPage_error.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <h4>errorPage 디렉티브 태그</h4> 에러가 발생했습니다. </body> </html>
06_03_page_errorPage.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page errorPage="06_03_page_errorPage_error.jsp" %> <%--아래 내용 다 지우고 위에 기술된 페이지 내용으로 띄운다. 주소값도 바뀜 --%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <% out.print("에러테스트"); String str=null; //복제불가, null값, 에러원인 out.println(str.toString()); out.print("에러테스트 종료"); %> </body> </html>
728x90
반응형
'[JAVA]' 카테고리의 다른 글
[JSP] 08_01_.jsp - 액션태그 <jsp:include / forward> (0) | 2024.03.13 |
---|---|
[JSP] 03_01_scriptlet.jsp - 덧셈, 짝수 (0) | 2024.03.12 |
[21일차] (0) | 2024.01.10 |
[20일차] PrintWriter Thread synchronized Join Network (0) | 2024.01.09 |
[19일차] Exception try ~ catch throws stack (0) | 2024.01.08 |