「Struts2 if」の版間の差分
ナビゲーションに移動
検索に移動
(ページの作成:「==Struts2 ifタグ== {{include_html banner_html, "!Struts"}} 条件分岐、if単体および、elseIf、else と併せて利用 ===if=== =====パラメータ=====…」) |
|||
| 75行目: | 75行目: | ||
===使用例=== | ===使用例=== | ||
| − | + | <s:if test="%{false}"> | |
| − | + | <div>Will Not Be Executed</div> | |
| − | + | </s:if> | |
| − | + | <s:elseif test="%{true}"> | |
| − | + | <div>Will Be Executed</div> | |
| − | + | </s:elseif> | |
| − | + | <s:else> | |
| − | + | <div>Will Not Be Executed</div> | |
| − | + | </s:else> | |
---- | ---- | ||
{{include_html banner_html, "!Struts"}} | {{include_html banner_html, "!Struts"}} | ||
2020年2月15日 (土) 08:06時点における版
Struts2 ifタグ
テンプレート:Include html banner html, "!Struts"
条件分岐、if単体および、elseIf、else と併せて利用
if
パラメータ
| タグ名 | 必須 | デフォルト | 評価 | 型 | 内容 |
|---|---|---|---|---|---|
| id | false | true | String | 要素参照用ID. UIや、FORMタグ用。HTMLのid属性として利用される。 | |
| test | true | true | Boolean | タグの内容を表示するか決定する式。 |
elseIf
パラメータ
| タグ名 | 必須 | デフォルト | 評価 | 型 | 内容 |
|---|---|---|---|---|---|
| id | false | true | String | 要素参照用ID. UIや、FORMタグ用。HTMLのid属性として利用される。 | |
| test | true | true | Boolean | タグの内容を表示するか決定する式。 |
else
パラメータ
| タグ名 | 必須 | デフォルト | 評価 | 型 | 内容 |
|---|---|---|---|---|---|
| id | false | true | String | 要素参照用ID. UIや、FORMタグ用。HTMLのid属性として利用される。 |
使用例
<s:if test="%{false}">
<div>Will Not Be Executed</div>
</s:if>
<s:elseif test="%{true}">
<div>Will Be Executed</div>
</s:elseif>
<s:else>
<div>Will Not Be Executed</div>
</s:else>
© 2006 矢木浩人