Cubby tags
Tag link
アクションクラス名、アクションメソッド名から URL を出力します。 ボディ部に t:param タグ置くことで、URL 埋め込みのパラメータやクエリ文字列のパラメータを指定することができます。
Example:
[1] URL をそのまま出力 (JSP) <t:link actionClass="com.example.action.FooAction" actionMethod="bar" /> (実行結果) /(contextPath)/foo/bar [2] URL を a タグに出力 (JSP) <t:link actionClass="com.example.action.FooAction" actionMethod="bar" tag="a" attr="href"> link to action </t:link> (実行結果) <a href="/(contextPath)/foo/bar"> link to action </a> [3] パラメータ指定 (アクションメソッドに @Path("baz/{id}") という指定があった場合) (JSP) <t:link actionClass="com.example.action.FooAction" actionMethod="bar" tag="a" attr="href"> <t:param name="id" value="123" /> <t:param name="token" value="abc" /> link to action </t:link> (実行結果) <a href="/(contextPath)/foo/bar/123&token=abc"> link to action </a> [4] プロトコル(HTTPS)を指定して出力 (JSP) <t:link actionClass="com.example.action.FooAction" actionMethod="bar" protocol="https"/> (実行結果) https://www.example.com/(contextPath)/foo/bar
Tag Information |
Tag Class | org.seasar.cubby.tags.LinkTag |
TagExtraInfo Class | None |
Body Content | scriptless |
Display Name | None |
Attributes |
Name | Required | Request-time | Type | Description |
tag | false | true | java.lang.String | URL を a や img など、指定された HTML タグの属性として出力します。 この属性を指定したときは、必ず attribute 属性も指定してください。 |
attr | false | true | java.lang.Class | tag 属性が指定された時に、a なら href、img なら src など、タグのどの属性に URL を出力するかを指定します。 tag 属性を指定したときは必ず指定してください。 |
actionClass | true | true | java.lang.String | FQCN 形式でアクションクラスを指定します。 |
actionMethod | true | true | java.lang.String | アクションメソッドを指定します。 |
encodeURL | false | true | java.lang.Boolean | 出力する URL を HttpServletResponse#encodeURL(String) でエンコードするかを指定します。デフォルトは true です。 |
protocol | false | true | java.lang.String | 出力する URL のプロトコルを指定します。主にhttps/httpの切り替えに使用します。 |
port | false | true | java.lang.Integer | 出力する URL のポートを指定します。 |
Variables |
No Variables Defined. |
Output Generated by
Tag Library Documentation Generator.
Java, JSP, and JavaServer Pages are trademarks or
registered trademarks of Sun Microsystems, Inc. in the US and other
countries. Copyright 2002-4 Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, CA 95054, U.S.A.
All Rights Reserved.