<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFIMPORT</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFIMPORT</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">説明</span>
<p>
cfimport タグを使用すると、次のいずれかをインポートすることができます。
</p>
<ul>

<li>カスタムタグライブラリとして、ディレクトリ内のすべての ColdFusion ページ。</li>

<li>Java Server Page (JSP) タグライブラリ。JSP タグライブラリは、JSP 1.1 タグ拡張 API に準拠しているタグハンドラのパッケージセットです。 </li>
</ul>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">カテゴリ</span>
<p>
アプリケーションフレームワークタグ
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</span><pre>&lt;cfimport
   taglib = &quot;taglib-location&quot;
   prefix = &quot;custom&quot;&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">関連項目</span>
<p>
cfapplication 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">ヒストリ</span>
<p>
ColdFusion&#160;MX: このタグが追加されました。
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">使用方法</span>
<p>
次の例では、myCustomTags ディレクトリからタグをインポートします。
</p>
<pre>&lt;cfimport
   prefix=&quot;mytags&quot;
   taglib=&quot;myCustomTags&quot;&gt;
</pre>
<p>
1 つの接頭辞で複数のタグライブラリをインポートできます。ライブラリ内に重複タグがある場合は、1 番めのタグが優先されます。
</p>

<p>
JSP タグには固定の属性があります。ただし、タグが実行時属性式をサポートしている場合は、ほとんどのタグライブラリで #expressions# というシンタックスを使用できます。 
</p>

<p>
CFML ページ内で JSP タグを参照する場合は、&lt;prefix:tagname&gt; というシンタックスを使用します。この prefix 属性には接頭辞の値を設定します。 
</p>

<p>
ColdFusion ページでカスタム JSP タグを使用するには :
</p>
<ol type="1">

<li>myjsptags.jar などの JSP タグライブラリの JAR ファイルを、ColdFusion サーバーのディレクトリ wwwroot/WEB-INF/lib に置きます。タグライブラリが独立した TLD ファイルを持っている場合は、TLD ファイルを JAR ファイルと同じディレクトリに配置します。</li>

<li>CFML ページの先頭に次のようなコードを挿入します。</li>
<pre>&lt;cfimport
   prefix=&quot;mytags&quot;
   taglib=&quot;/WEB-INF/lib/myjsptags.jar&quot;&gt;
</pre></ol>

<p>
JAR ファイルから JSP タグを参照するには、次のシンタックスを使用します。
</p>
<pre>&lt;cfoutput&gt;
   &lt;mytags:helloTag message=&quot;#mymessage#&quot; /&gt;
&lt;cfoutput&gt;
</pre>
<p>
cfimport タグは、インポートされたタグを使用するページ上に存在する必要があります。たとえば、cfinclude 呼び出しでインクルードするページ上に cfimport タグを記述した場合は、cfinclude タグを含んでいるページ上ではインポートされたタグを使用できません。同様に、Application.cfm ページ上に cfimport タグを記述した場合、インポートされたタグを使用できるのは Application.cfm ページだけです。アプリケーション内のその他のページでは使用できません。この状況でエラーが返されることはありませんが、インポートされたタグは機能しません。 
</p>

<p>
cfimport タグを使用してタグライブラリからの出力を抑制することはできません。
</p>

<p>
詳細については、JSP 1.1 の仕様書を参照してください。 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">例</span><pre>&lt;h3&gt;cfimport の例&lt;/h3&gt;
&lt;p&gt;この例では、Jakarta Taglibs プロジェクト
(http://jakarta.apache.org/taglibs/) から入手できるランダム JSP タグライブラリを使用します。

&lt;cfimport taglib=&quot;/WEB-INF/lib/taglibs-random.jar&quot; prefix=&quot;randomnum&quot;&gt;

&lt;randomnum:number id=&quot;randPass&quot; range=&quot;000000-999999&quot; algorithm=&quot;SHA1PRNG&quot; provider=&quot;SUN&quot; /&gt;
&lt;cfset myPassword = randPass.random&gt;
&lt;cfoutput&gt;
  パスワードは #myPassword# です。&lt;br&gt;
&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="TAGLIB">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TAGLIB</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>タグライブラリの URI です。このパスは、Web ルートを基準とする相対パス (/ で始まる) か、現在のページの場所、または Administrator ColdFusion マッピングページ内で指定したディレクトリを基準とする相対パスである必要があります。</p><ul>

<li>カスタム ColdFusion タグが保管されているディレクトリ。この場合は、このディレクトリ内のすべての cfm ページがタグライブラリ内のカスタムタグとして扱われます。</li>

<li>Web アプリケーションの JAR へのパス (例 : &quot;/WEB-INF/lib/sometags.jar&quot;)。</li>

<li>タグライブラリディスクリプタへのパス <br>(例 : &quot;/sometags.tld&quot;)。</li>
</ul>

<p>メモ : JSP カスタムタグライブラリは /WEB-IN/lib ディレクトリ内に置く必要があります。この制限は ColdFusion ページには適用されません。</p>

  </td>
  </tr>
  </table>
</div>
<div id="PREFIX">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PREFIX</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>インポートされたカスタム JSP タグにアクセスするための接頭辞です。 </p>
<p>CFML カスタムタグディレクトリをインポートするときに、この属性に空の値 &quot;&quot; を指定した場合は、そのカスタムタグを接頭辞なしで呼び出すことができます。JSP タグライブラリについては、接頭辞を指定して使用する必要があります。</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
