1.Remoting の前準備 |
1.1 Webアプリケーションの登録
Apacheを利用し、Tomcatとの連携が CoyoteJK2 の場合は、 Apache のホームディレクトリの下の conf ディレクトリの中の workers2.properties に次の記述を追加します。
ここでのWebアプリケーションの名前は「UserCheck」とします。
(以降 Webアプリケーションのディレクトリを<%WEB_HOME%> と表現します。)
|
 |
|
|
1行目 :Webアプリケーション名
|
1.2 Remotingライブラリの準備
RemotingではWebアプリケーションのディレクトリ毎に専用のライブラリを配置する必要があります。
Remotingをインストールした時の flashgateway 又は flashgateway-sample ディレクトリ内のライブラリから、以下のファイルを <%WEB_HOME%>\WEB-INF\lib にコピーします。
|
1.3 デプロイメントディスクリプタの作成
今回はデータベースをアクセスする部分をJSPで作成するため、TomcatでのWebアプリケーションのデプロイメントディスクリプタ(配備記述子)ファイルを編集します。
flashgateway-sample ディレクトリ内の web.xml を <%WEB_HOME%>\WEB-INF にコピーし、簡単な変更を行います。
|
 |
| |
1: <?xml version="1.0" encoding="UTF-8"?>
2: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
3: "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
4: <web-app>
5: <display-name>Macromedia Flash Remoting MX</display-name>
6: <description>Flash Remoting MX for Java Application Servers</description>
7:
8: <servlet>
9: <servlet-name>FlashGatewayServlet</servlet-name>
10: <display-name>Flash Remoting MX Servlet</display-name>
11: <description>Servlet-based plugin to Flash Remoting</description>
12: <servlet-class>flashgateway.controller.GatewayServlet</servlet-class>
13: <init-param>
14: <param-name>LOG_LEVEL</param-name>
15: <param-value>Debug</param-value>
16: <description>Controls the level of information logged.</description>
17: </init-param>
18: <init-param>
19: <param-name>DISABLE_JAVA_ADAPTERS</param-name>
20: <param-value>false</param-value>
21: <description>When set to true, .......(省略).....</description>
22: </init-param>
23: <load-on-startup>1</load-on-startup>
24: </servlet>
25:
26: <servlet-mapping>
27: <servlet-name>FlashGatewayServlet</servlet-name>
28: <url-pattern>/gateway</url-pattern>
29: </servlet-mapping>
30:
31: <!-- JSPファイルをFlashから呼び出すためのマッピング -->
32: <servlet>
33: <servlet-name>userCheck</servlet-name>
34: <display-name></display-name>
35: <description></description>
36: <jsp-file>UserCheck.jsp</jsp-file>
37: </servlet>
38:
39: <welcome-file-list>
40: <welcome-file>index.jsp</welcome-file>
41: <welcome-file>index.html</welcome-file>
42: </welcome-file-list>
43:
44: </web-app>
|
|
| web.xml |
|
1-29行目 :サンプルと同じで固定
31-37行目 :JSPファイルをFlashから呼び出すためのマッピング
33行目 :サーブレット名 userCheck (先頭を小文字にしているのに注意)
36行目 :JSPファイル名 UserCheck.jsp
39-41行目:サンプルと同じで固定
|
|