[ 
https://issues.apache.org/struts/browse/TILES-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Antonio Petrelli closed TILES-241.
----------------------------------


> Struts2 action was not able call from tiles.xml file
> ----------------------------------------------------
>
>                 Key: TILES-241
>                 URL: https://issues.apache.org/struts/browse/TILES-241
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.0.5
>         Environment: apache 6.0/Struts 2/Tiles2
>            Reporter: Ramesh
>
> I was not able to call struts2 action from tiles 2 definition. Redirect works 
> but not from tiles.xml. I'm getting following error message. 
> The requested resource (/struts1/s2action) is not available
> Please advise me.
> Thanks in advance
> web.xml
> <web-app>
>     <filter>
>         <filter-name>webwork</filter-name>
>         
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>     </filter>
>     <filter-mapping>
>         <filter-name>webwork</filter-name>
>         <url-pattern>*.action</url-pattern>
>     </filter-mapping>
>  
>    <listener>
>       
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>    </listener>  
>    .....
>    .....
> </web-app>
> index.jsp
> <%@ page contentType="text/html" %>
> <%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>
> <c:redirect url="http://localhost:8080/struts1/welcome.action"/> 
> struts.xml
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE struts PUBLIC
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
> <struts>
> <constant name="struts.enable.DynamicMethodInvocation" value="false" />
> <constant name="struts.devMode" value="true" />
> <package name="Webtest" extends="struts-default">
>     <result-types>
>       <result-type name="tiles" 
> class="org.apache.struts2.views.tiles.TilesResult"/>
>     </result-types>
>     <action name="st2action" class="com.action.st2Action" >
>       <result name="SUCCESS">/jsp/st2/st2.jsp</result>
>     </action>
>     <action name="welcome" class="com.action.welcome" >
>       <result name="SUCCESS" type="tiles">both</result>
>     </action>
> </package>
> </struts>
> tiles.xml
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>  <!DOCTYPE tiles-definitions PUBLIC
>        "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
>        "http://tiles.apache.org/dtds/tiles-config_2_0.dtd";>
> <tiles-definitions>
>   <definition name="both" template="/jsp/st2/layout.jsp">
>       <put-attribute name="title"  value="This is the title."/>
>       <put-attribute name="header" value="/jsp/header.jsp"/>
>       <put-attribute name="body"  value="st2action.action"/>
>       <put-attribute name="footer" value="/jsp/footer.jsp"/>
>   </definition>
> </tiles-definitions>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to