- [JSP] 27. 센치미터-인치 변환 페이지 만들어보기2024년 07월 04일
- Song hyun
- 작성자
- 2024.07.04.:48
728x90반응형[JSP] 27. 센치미터-인치 변환 페이지 만들어보기
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <footer class="footer"> <p>푸터푸터 얍 © 2024</p> </footer> </body> </html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="styles.css"> </head> <body> <div> <%@ include file="header.jsp"%> <div class="main"> <h3 class="title">cm를 인치로 변환</h3> <form action="result.jsp" method="POST"> <input type="text" id="cm" required="required" name="cm"> <button class="button" type="submit">변환</button> </form> </div> <%@ include file="footer.jsp"%> </div> </body> </html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="styles.css"> <meta charset="UTF-8"> <title>결과창</title> </head> <body> <div> <%@ include file="header.jsp"%> <div class="result"> <h3 class="title">변환 결과</h3> <% java.text.DecimalFormat df=new java.text.DecimalFormat("###,###"); String cm=request.getParameter("cm"); int intNum=Integer.parseInt(cm); double result=(intNum/2.54); String printNum=df.format(result); if(cm==null || cm.trim().isEmpty()){ out.println("<p> 앗, 다시 입력해주세요. </p>"); } else { out.println("<p> 결과 : "+result+"</p>"); } %> <button class="back"><a href="form_page.jsp">Back</a></button> </div> <%@ include file="footer.jsp"%> </div> </body> </html>
@charset "UTF-8"; body{ margin : 0; padding : 0; display: flex-reverse; justify-content: center; font-family: arial; background-color:#F2F2F2; } .header{ display: flex; height:50px; background-color: black; color: white; justify-content: space-between; align-items: center; padding: 0 30px; text-decoration: none; } .buttons{ color:white; display: flex; list-style: none; flex-direction: row; text-align: right; flex-wrap: wrap; justify-content: flex-end; margin-left: 20px; } .main{ margin-top:100px; justify-content:center; align-items: center; text-align: center; height: 300px; } .result{ margin-top:100px; justify-content:center; align-items: center; text-align: center; height: 300px; } a { text-decoration: none; color: white; }
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="styles.css"> <meta charset="UTF-8"> <title>결과창</title> </head> <body> <div> <%@ include file="header.jsp"%> <div class="main"> <h2> 로그인은 안 만들었습니다... </h2> </div> <%@ include file="footer.jsp"%> </div> </body> </html>
728x90반응형'JSP' 카테고리의 다른 글
[JSP] 29. JSP 내장 객체 (0) 2024.07.04 [JSP] 28. JSP 지시자 (Directive) (0) 2024.07.04 [JSP] 26. JSP 주석과 지시자 (0) 2024.07.04 [JSP] 25. JSP와 HTML을 사용해 계산기 만들기 (0) 2024.07.04 [JSP] 24. JSP와 HTML을 사용해 인사말 생성기 만들기 (0) 2024.07.04 다음글이전글이전 글이 없습니다.댓글
스킨 업데이트 안내
현재 이용하고 계신 스킨의 버전보다 더 높은 최신 버전이 감지 되었습니다. 최신버전 스킨 파일을 다운로드 받을 수 있는 페이지로 이동하시겠습니까?
("아니오" 를 선택할 시 30일 동안 최신 버전이 감지되어도 모달 창이 표시되지 않습니다.)