Web Application vs. Application
Web Server(tomcat 등) vs. OS 상
서버에 배포(deploy) vs. 실행(execute)
tomcat : Web Container, 웹 애플리케이션 실행 및 관리 환경
-> WAS (Web Application Server) : TomEE, WildFly, WebLogic, WebSphere (사용)
war (web archive) : 웹 애플리케이션을 배포하지 위한 묶음 파일 (프로젝트 디렉터리 구조와는 다름)
webapp은 web application의 server page들의 최상위 경로, web context와 같은 레벨임
** convert button.html to button.jsp
1. <%@ page : 페이지 지시자(directive)로 해당 페이지가 jsp 페이지임을 지정함.
(index.jsp의 페이지 지시자를 복사)
2. 확장자를 .html -> .jsp 변경
https://mvnrepository.com/artifact/jakarta.servlet.jsp.jstl/jakarta.servlet.jsp.jstl-api/3.0.2
https://mvnrepository.com/artifact/org.glassfish.web/jakarta.servlet.jsp.jstl/3.0.1
https://tomcat.apache.org/whichversion.html
Apache Tomcat® - Which Version Do I Want?
Apache Tomcat® is an open source software implementation of a subset of the Jakarta EE (formally Java EE) technologies. Different versions of Apache Tomcat are available for different versions of the specifications. The mapping between the specifications
tomcat.apache.org
html을 jsp로 변환하기
** convert button.html to button.jsp
1. <%@ page : 페이지 지시자(directive)로 해당 페이지가 jsp 페이지임을 지정함.
(index.jsp의 페이지 지시자를 복사)
2. 확장자를 .html -> .jsp 변경
코드 내용 수정시 프로그램을 알아서 수정하는 기능(리팩토링)
// 현재 위치는 /blog, 따라서 blog 아래의 css, js 경로를 접근 할 수 있음
public class HelloServlet extends HttpServlet {
private String message;
public void init() {
message = "Hello World!";
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
// about : ./blog/about.jsp
String pageName = "./" + request.getParameter("page") + ".jsp";
request.getRequestDispatcher(pageName).forward(request, response);
}
코드 내용 수정시 프로그램을 알아서 수정하는 기능(리팩토링)
****외우삼****
servlet은 무조건 /로 시작
jsp는 ./로 시작