RRD를 사용하여 원격 웹 또는 포틀릿 애플리케이션과 함께 웹 애플리케이션 배치
RRD(Remote Request Dispatcher)는 애플리케이션 프레임워크, 서블릿 및 JSP(JavaServer Pages)가 현재 실행 자원의 JVM(Java™ Virtual Machine)의 외부에서 컨텐츠를 클라이언트에 전송된 응답의 일부로 포함할 수 있는 웹 컨테이너의 플러그 가능 확장입니다.
시작하기 전에
프로시저
- 콘솔을 사용하여 엔터프라이즈 애플리케이션 파일을 설치하십시오.
- 애플리케이션 및 원격 자원 간의 포함 요청 전송을 구성하십시오.
- 원격 포함을 디스패치하도록 웹 애플리케이션을 구성하십시오.
- 원격 포함을 서비스하도록 웹 애플리케이션을 구성하십시오.
- 옵션: 애플리케이션을 수정하여 Servlet 프로그래밍 모델을 사용한 두 가지의 서로 다른 컨텍스트에 있는
자원을 찾으십시오.
원격으로 자원을 포함하는 서블릿 프로그래밍 모델에서는 비Java EE(Java Platform, Enterprise Edition) 서블릿 API(Application Programming Interface)를 사용하지 않아도 됩니다. RRD(Remote Request Dispatcher) 컴포넌트는 동일한 규칙에 따라 ServletContext 및 원격 자원을 구합니다. JSTL(JavaServer Pages standard tag library)을 사용하는 경우, 다음 단계에 필요한 ServletContext 오브젝트 또는 RequestDispatcher를 애플리케이션이 구하지 않아도 됩니다. JSTL 사용자 정의 태그가 암시적으로 이를 구하기 때문입니다. 샘플 JSP(JavaServer Pages) 애플리케이션의 다음 예제를 검토하여 두 가지 다른 컨텍스트(투자 및 뱅킹)에 있는 자원을 찾는 방법을 학습합니다.
<HEAD> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8059-1" isELIgnored="false" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" $> </HEAD> <BODY> <%-- Programming example using JavaServer Pages and JavaSever Pages Standard Tag Library (JSTL). JSTL provides a custom tag to import contents (in servlet and JSP terms include) in the scope of the same request from outside of the current web module context by specifying a context parameter. JSTL restriction: The web module that is imported must run inside of the same JVM as the calling resource if imported URL is not fully qualified. RRD extends this functionality by permitting the web module to be located within the scope of the current WebSphere Application Server core group versus the scope of the JVM. --%> <hr size="5"/> <%-- Include resource investmentSummary.jsp located in the web application with context root of /investments. --%> <c:import url="investmentSummary.jsp" context="/investments"/> <hr size="5"/> <%-- Include resource accountSummary.jsp located in the web application with context root of /banking. --%> <c:import url="accountSummary.jsp" context="/banking"/> <hr size="5"/> </BODY> </HTML>
- 옵션: 애플리케이션을 수정하여 프레임워크 프로그래밍 모델을 사용한 두 가지의 서로 다른 컨텍스트에 있는
자원을 찾으십시오.
원격으로 자원을 포함하는 프레임워크 프로그래밍 모델에서는 비Java EE(Java Platform, Enterprise Edition)를 사용하지 않아도 됩니다. 현재 웹 컨테이너 내부에서 실행하고 있지 않은 ServletContext 이름으로 요청이 시작된 경우, RRD(Remote Request Dispatcher) 컴포넌트는 자원이 있고 해당 ServletContext 오브젝트에서 RRD가 사용 가능하면 WebSphere Application Server WebSphere Application Server, Network Deployment 환경에 있는 자원을 찾을 수 있는 ServletContext 오브젝트를 리턴합니다. 두 가지 다른 컨텍스트(투자 및 뱅킹)에 있는 자원을 찾는 방법을 설명하는 다음의 샘플 프레임워크 스니펫을 검토합니다.
/* Programming example using a generic framework. Servlet Specification provides an API to obtain a servlet context in the scope of the same request different from the current web module context by specifying a context parameter. Servlet Specification restriction: The web module that obtain must run inside of the same JVM as the calling resource. RRD extends this functionality by permitting the web module to be located within the scope of the current WebSphere Application Server core group versus the scope of the JVM. */ protected void frameworkCall (ServletContext context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException( PrintWriter writer = response.getWriter(); writer.write("<HTML>"); writer.write("<HEAD>"); writer.write("</HEAD>"); writer.write("<BODY>"); writer.write("<hr size=\"5/">); //Include resource investmentSummary.jsp located in web application //with context root of /investments. RequestDispatcher rd = getRequestDispatcher ( context, "/investments", "/investmentSummary.jsp"); rd.include(request, response); writer.write("<hr size=\"5/">); //Include resource accountSummary.jsp located in web application //with context root of /banking. rd = getRequestDispatcher ( context, "/banking", "/accountSummary.jsp"); rd.include(request, response); writer.write("</BODY>"); writer.write("</HTML>"); } private RequestDispatcher getRequestDispatcher (ServletContext context, String contextName, String resource) { return context.getContext(contexName).getRequestDispatcher(resource); }
결과
다음에 수행할 작업
하위 주제
원격 요청 디스패처
RRD(Remote Request Dispatcher)는 애플리케이션 프레임워크, 서블릿 및 JavaServer Pages에 현재 실행 중인 자원 JVM(Java Virtual Machine) 외부에서 컨텐츠를 클라이언트에 전송된 응답의 일부로 포함하기 위한 웹 컨테이너의 플러그 가능 확장입니다.


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tweb_rrd_overview
파일 이름:tweb_rrd_overview.html