QA@IT
«回答へ戻る

追記 2013 12 18

48
 ```java:***Action.java
 @Result(name="success", type="tiles", location="filename")
 ```
+
+# 追記
+
+以下に最小稼動ソースを記述
+[http://qiita.com/asahina_dev/items/7b28638c578a553ade0d]

struts2-tiles-plugin が有効になっていない。

  • Register the tiles listener. This listener will typically either be the standard tiles listener (org.apache.tiles.listener.TilesListener) or the Struts2 replacement (org.apache.struts2.tiles.TilesListener). The latter provides tighter integration with Struts features such as freemarker integration.

  • web.xml

<listener>
  <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
  • struts.xml
<result-types>
  <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
<action name="sample" class="org.apache.struts2.tiles.example.SampleAction" >
  <result name="success" type="tiles">tilesWorks</result>
</action>
  • アノテーションの場合の result
@Result(name="success", type="tiles", location="filename")

追記

以下に最小稼動ソースを記述
[http://qiita.com/asahina_dev/items/7b28638c578a553ade0d]

struts2-tiles-plugin が有効になっていない。


* Register the tiles listener. This listener will typically either be the standard tiles listener (org.apache.tiles.listener.TilesListener) or the Struts2 replacement (org.apache.struts2.tiles.TilesListener). The latter provides tighter integration with Struts features such as freemarker integration.

* web.xml

```xml
<listener>
  <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
```

* struts.xml

```xml
<result-types>
  <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
```

```xml
<action name="sample" class="org.apache.struts2.tiles.example.SampleAction" >
  <result name="success" type="tiles">tilesWorks</result>
</action>
```

* アノテーションの場合の result

```java:***Action.java
@Result(name="success", type="tiles", location="filename")
```

# 追記

以下に最小稼動ソースを記述
[http://qiita.com/asahina_dev/items/7b28638c578a553ade0d]

回答を投稿

struts2-tiles-plugin が有効になっていない。

  • Register the tiles listener. This listener will typically either be the standard tiles listener (org.apache.tiles.listener.TilesListener) or the Struts2 replacement (org.apache.struts2.tiles.TilesListener). The latter provides tighter integration with Struts features such as freemarker integration.

  • web.xml

<listener>
  <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
  • struts.xml
<result-types>
  <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
<action name="sample" class="org.apache.struts2.tiles.example.SampleAction" >
  <result name="success" type="tiles">tilesWorks</result>
</action>
  • アノテーションの場合の result
@Result(name="success", type="tiles", location="filename")
struts2-tiles-plugin が有効になっていない。


* Register the tiles listener. This listener will typically either be the standard tiles listener (org.apache.tiles.listener.TilesListener) or the Struts2 replacement (org.apache.struts2.tiles.TilesListener). The latter provides tighter integration with Struts features such as freemarker integration.

* web.xml

```xml
<listener>
  <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
```

* struts.xml

```xml
<result-types>
  <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
```

```xml
<action name="sample" class="org.apache.struts2.tiles.example.SampleAction" >
  <result name="success" type="tiles">tilesWorks</result>
</action>
```

* アノテーションの場合の result

```java:***Action.java
@Result(name="success", type="tiles", location="filename")
```