본문 바로가기
728x90
반응형

FrontController3

FrontController 사용하기 FrontController는 사용자가 페이지의 요청을 보냈을때 frontController에서 요청에 맞는 Controller로 보내줄것이다. 그러기 위해선 페이지요청을 모두 FrontController로 보내야하는데, 그 역할은 Web.xml이 할 것이다. web.xml에서는 " .do " 로 들어오는 url을 모두 FrontController에서 처리요청을 하고있다. .do는 가상경로이다. Servlet / Web.xml 에서 controller 연결 Web.xml 이란? Web Application의 배포 서술자(DD, Deployment Descriptor)이다. 웹 애플리케이션의 배포 관련 설정을 위해 작성하는 파일이고, WEB-INF/web.xml 파일에 위치하고, 서블릿과 JSP를 어떻게 .. 2021. 6. 18.
Servlet / Web.xml 에서 controller 연결 Web.xml 이란? Web Application의 배포 서술자(DD, Deployment Descriptor)이다. 웹 애플리케이션의 배포 관련 설정을 위해 작성하는 파일이고, WEB-INF/web.xml 파일에 위치하고, 서블릿과 JSP를 어떻게 실행하느냐에 관한 정보가 들어있다. DD는 Tomcat 서버를 가동할 때 읽혀진다. web.xml의 시작과 종료를 한다. apiBoard 애플리케이션의 표시이름을 설정하는 부분이다. 이클립스에서는 기본적으로 프로젝트명이 설정되며, 필요하다면 수정 가능하다. index.html index.htm index.jsp default.html default.htm default.jsp 는 웹 서버 URL경로로 처음 들어왔을 때 클라이언트에 처음으로 노출되는 파일들을 .. 2021. 6. 3.
FrontController Servlet 생성/ 경로 잘라서 배열로 만들기request.getRequeestURI/request.getContextPath/requst.getRequestURL/requst.Servletpath() MVC패턴에서 FrontController Sevlet 생성하기 @WebServlet("/FrontController") public class FrontController extends HttpServlet { private static final long serialVersionUID = 1L; public FrontController() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String uri = request.getRequestURI(); int length = request.getContextPath(.. 2021. 5. 10.
728x90
반응형