RRD を使用した、リモート Web アプリケーションまたはポートレット・アプリケーションを持つ Web アプリケーションのデプロイ

リモート要求ディスパッチャー (RRD) は、アプリケーション・フレームワーク、サーブレット、および JavaServer Pages (JSP) が現在の実行リソースの Java™ 仮想マシン (JVM) の外部からのコンテンツを、クライアントに送信された応答の一部として含むことができるようにする、Web コンテナーへのプラグ可能な拡張機能です。

始める前に

リモート要求ディスパッチャー機能を使用するには、WebSphere® Application Server Network Deployment がインストールされている必要があります。また、リモート要求ディスパッチャーの制限事項についても、良く知っている必要があります。 詳しくは、『リモート要求ディスパッチャーに関する考慮事項』の項目を参照してください。

手順

  1. コンソールでエンタープライズ・アプリケーションのファイルをインストールします。
  2. アプリケーションとリモート・リソース間でインクルード要求の送信を構成します。
    • リモート組み込みをディスパッチするように Web アプリケーションを構成します。
    • リモート組み込みをサービス提供するように Web アプリケーションを構成します。
  3. オプション: サーブレット・プログラミング・モデルを使用して 2 つの異なるコンテキストにあるリソースを見つけるように、アプリケーションを変更します。

    リモート側にリソースを組み込むためのサーブレット・プログラミング・モデルでは、 非 Java Platform, Enterprise Edition (Java EE) サーブレットのアプリケーション・プログラミング・インターフェース (API) を使用する必要はありません。リモート要求ディスパッチャー (RRD) コンポーネントは、 同じ規則に従って ServletContext とリモート・リソースを取得します。 JavaServer Pages 標準タグ・ライブラリー (JSTL) を使用することにより、 以下のステップのフレームワークの例で必要とされている ServletContext オブジェクトまたは RequestDispatcher の取得をアプリケーションで実行する必要がなくなります。これは、JSTL カスタム・タグによって暗黙的に取得が行われるためです。 以下のサンプル JavaServer Pages アプリケーションの例を参考に、2 つの異なるコンテキスト (investments と banking) 内のリソースを探す方法を学んでください。

    <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>
  4. オプション: フレームワーク・プログラミング・モデルを使用して 2 つの異なるコンテキストにあるリソースを見つけるように、アプリケーションを変更します。

    リモート側でリソースを組み込むフレームワーク・プログラミング・モデルでは、Java Platform, Enterprise Edition (Java EE) 以外の サーブレットのアプリケーション・プログラミング・インターフェース (API) を使用する必要がありません。 現行の Web コンテナー内で現在稼働していない ServletContext 名に対して要求が開始されると、リモート要求ディスパッチャー (RRD) コンポーネントは ServletContext オブジェクトを戻します。このオブジェクトにより、WebSphere Application Sever WebSphere Application Server Network Deployment 環境の任意の場所にリソースが存在し、RRD がその ServletContext オブジェクトに対して有効である場合には、そのリソースを探し出すことができます。以下のフレームワーク・スニペット例は、 2 つの異なるコンテキスト (investments と banking) に存在するリソースを探す方法の実例です。参考にしてください。

    /*
    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);
    }

タスクの結果

少なくとも 1 つのエンタープライズ・アプリケーションがリモート組み込みをディスパッチするために使用可能にされ、また少なくとも 1 つのエンタープライズ・アプリケーションがリモート組み込みを処理するために使用可能にされた後、RRD が使用可能となります。

次のタスク

既にインストールされている場合は、変更されたアプリケーションを再始動し、あるいは新規にインストールされたアプリケーションを開始して、各アプリケーション上で RRD を使用可能にします。

トピックのタイプを示すアイコン タスク・トピック



タイム・スタンプ・アイコン 最終更新: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tweb_rrd_overview
ファイル名:tweb_rrd_overview.html