You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Carlos Curotto <ca...@gmail.com> on 2008/10/29 20:53:58 UTC

Struts 2 + Tiles 2

Hi everyone,

I am trying to configure Struts 2 version 2.0.12 and Tiles 2.

When i call an action that uses tiles, i am getting this exception:

javax.servlet.ServletException: Error including path
'/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)


common.jsp is the file that contains the tiles tamplate, here is that file:

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <body>
        <table>
            <tr>
                <td>
                    <tiles:insertAttribute name="header" />
                </td>
            </tr>
            <tr>
                <td>
                    <tiles:insertAttribute name="body" />
                </td>
            </tr>
            <tr>
                <td>
                    <tiles:insertAttribute name="footer" />
                </td>
            </tr>
        </table>
    </body>
</html>

also, here is my tiles.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
    <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
        <put name="title" value="Panorama Grid Console"/>
        <put name="header" value="/WEB-INF/layout/header.jsp"/>
        <put name="body" value="/WEB-INF/view/home.jsp"/>
        <put name="footer" value="/WEB-INF/layout/footer.jsp"/>
    </definition>
</tiles-definitions>

i have tried with put and put-attribute and i am getting the same exception
for both of them.

Finally, here is my web.xml

<web-app id="PanoramaGridConsole" version="2.4" xmlns="
http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <!-- Struts 2 Filter -->
    <filter>
        <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>

    <!-- Struts 2 Filter Mapping -->
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- Struts 2 Tiles Listener -->
    <listener>

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

</web-app>

Am i missing something? is this a bug related to struts 2??? Anyone have
seen this before?

Thanks in advance,

-- 
Carlos Curotto

Re: Struts 2 + Tiles 2

Posted by Antonio <an...@gmail.com>.
2008/10/29 Carlos Curotto <ca...@gmail.com>:
> javax.servlet.ServletException: Error including path
> '/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute

Please post the complete stacktrace.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 + Tiles 2

Posted by Antonio <an...@gmail.com>.
2008/11/12 Carlos Curotto <ca...@gmail.com>:
>    <dependency>
>     <groupId>org.apache.tiles</groupId>
>      <artifactId>tiles-jsp</artifactId>
>      <version>2.0.4</version>
>    </dependency>

I suggest to use version 2.0.6

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 + Tiles 2

Posted by Carlos Curotto <ca...@gmail.com>.
Hi everyone,

I solved my problem.

Look at my pom file, i have the tiles-jsp dependency but version 2.1.0, and
the struts2-tiles-plugin added the tiles-api jar but with version 2.0.4, so
i have changed my dependency for this:

    <dependency>
     <groupId>org.apache.tiles</groupId>
      <artifactId>tiles-jsp</artifactId>
      <version>2.0.4</version>
    </dependency>

And that's it.  The rest if fine.

Thanks!!

Carlos Curotto.

On Wed, Nov 12, 2008 at 3:03 PM, Carlos Curotto <ca...@gmail.com>wrote:

> Alberto, here are my configuration:
>
> *This is the complete stack trace of the excepcion i am getting:*
>
> HTTP Status 500 -
>
>
> --------------------------------------------------------------------------------
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
>
> exception
>
> javax.servlet.ServletException: Error including path
> '/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>
>
> root cause
>
> org.apache.tiles.TilesException: Error including path
> '/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute
>
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:425)
>
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:368)
>
> org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)
>
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
>
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
>
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
>
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>
>
> root cause
>
> java.io.IOException: Error including path '/WEB-INF/layout/common.jsp'.
> org/apache/tiles/ListAttribute
>
> org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:201)
>
> org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)
>
> org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesRequestContextWrapper.java:72)
>
> org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesRequestContext.java:86)
>
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:417)
>
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:368)
>
> org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)
>
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
>
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
>
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
>
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
>
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
>
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
>
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/5.5.26 logs.
>
>
>
> --------------------------------------------------------------------------------
>
> Apache Tomcat/5.5.26
>
> *These are the versions i am using, i put here my pom file:*
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.sac.panorama.datagrid.console</groupId>
>   <artifactId>panorama-grid-console</artifactId>
>   <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>panorama-grid-console</name>
>   <url>http://maven.apache.org</url>
>
>   <dependencies>
>
>     <dependency>
>      <groupId>org.apache.struts</groupId>
>       <artifactId>struts2-core</artifactId>
>       <version>2.0.12</version>
>     </dependency>
>
>     <dependency>
>      <groupId>org.apache.struts</groupId>
>       <artifactId>struts2-tiles-plugin</artifactId>
>       <version>2.0.12</version>
>     </dependency>
>
>     <dependency>
>      <groupId>org.apache.tiles</groupId>
>       <artifactId>tiles-jsp</artifactId>
>       <version>2.1.0</version>
>     </dependency>
>
>     <dependency>
>       <groupId>com.sac.panorama.datagrid</groupId>
>       <artifactId>panorama-grid-monitor-core</artifactId>
>       <version>3.0.0-dev-1</version>
>       <exclusions>
>         <exclusion>
>           <artifactId>ognl</artifactId>
>           <groupId>ognl</groupId>
>         </exclusion>
>       </exclusions>
>     </dependency>
>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>       <scope>test</scope>
>     </dependency>
>
>   </dependencies>
>
>   <repositories>
>     <repository>
>         <id>gunthers</id>
>         <name>Gunther's Archiva</name>
>         <url>http://gunthers-pc3:8080/archiva/repository/internal</url>
>     </repository>
>     <repository>
>         <id>central</id>
>         <name>IBiblio Maven2 Repository</name>
>         <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>         <id>default</id>
>         <name>Default Maven2 Repository</name>
>         <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>
>   <distributionManagement>
>     <repository>
>         <id>gunthers</id>
>         <name>Gunther's Archiva</name>
>         <url>http://gunthers-pc3:8080/archiva/repository/internal</url>
>     </repository>
>   </distributionManagement>
>
>   <build>
>         <directory>target</directory>
>         <sourceDirectory>src/main/java</sourceDirectory>
>         <testSourceDirectory>src/test/java</testSourceDirectory>
>         <outputDirectory>WEB-INF/classes</outputDirectory>
>         <testOutputDirectory>WEB-INF/test-classes</testOutputDirectory>
>         <finalName>${artifactId}</finalName>
>         <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <configuration>
>                    <source>1.5</source>
>                    <target>1.5</target>
>                </configuration>
>            </plugin>
>             </plugins>
>     </build>
>
> </project>
>
> *This is my web.xml file:*
>
> <web-app id="PanoramaGridConsole" version="2.4" xmlns="
> http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
>     <!-- Struts 2 Filter -->
>     <filter>
>         <filter-name>struts2</filter-name>
>
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>     </filter>
>
>     <!-- Struts 2 Filter Mapping -->
>     <filter-mapping>
>         <filter-name>struts2</filter-name>
>         <url-pattern>/*</url-pattern>
>     </filter-mapping>
>
>     <!-- Struts 2 Tiles Listener -->
>     <listener>
>
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>     </listener>
>
> </web-app>
>
> *This is my definitions file:*
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE tiles-definitions PUBLIC
>        "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
>        "http://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">
>
> <tiles-definitions>
>     <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
>         <put-attribute name="title" value="Panorama Grid Console"/>
>         <put-attribute name="header" value="/WEB-INF/layout/header.jsp"/>
>         <put-attribute name="body" value="/WEB-INF/view/home.jsp"/>
>         <put-attribute name="footer" value="/WEB-INF/layout/footer.jsp"/>
>     </definition>
> </tiles-definitions>
>
> *This is my common.jsp file that defines the layout:
>
> *
> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
> http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
>     <head>
>         <title><tiles:getAsString name="title"/></title>
>     </head>
>     <body>
>         <table>
>             <tr>
>                 <td>
>                     <tiles:insertAttribute name="header" />
>                 </td>
>             </tr>
>             <tr>
>                 <td>
>                     <tiles:insertAttribute name="body" />
>                 </td>
>             </tr>
>             <tr>
>                 <td>
>                     <tiles:insertAttribute name="footer" />
>                 </td>
>             </tr>
>         </table>
>     </body>
> </html>
>
> *This is my struts.xml file:
>
> *<?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>
>     <package name="home" extends="struts-default">
>         <result-types>
>                <result-type name="tiles"
> class="org.apache.struts2.views.tiles.TilesResult" />
>           </result-types>
>         <action name="Home"
> class="com.sac.panorama.datagrid.console.action.HomeAction">
>             <result name="success" type="tiles">home.layout</result>
>         </action>
>     </package>
> </struts>
>
>
> Thanks!!  Please, if anyone can help will be very welcome!
>
> Carlos Curotto.
>



-- 
Carlos Curotto

Re: Struts 2 + Tiles 2

Posted by Carlos Curotto <ca...@gmail.com>.
Alberto, here are my configuration:

*This is the complete stack trace of the excepcion i am getting:*

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Error including path
'/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)


root cause

org.apache.tiles.TilesException: Error including path
'/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute

org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:425)

org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:368)

org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)

org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)

com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)

com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)

org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)


root cause

java.io.IOException: Error including path '/WEB-INF/layout/common.jsp'.
org/apache/tiles/ListAttribute

org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:201)

org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)

org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesRequestContextWrapper.java:72)

org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesRequestContext.java:86)

org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:417)

org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:368)

org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)

org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)

com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)

com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)

org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)

com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)


note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.26 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.26

*These are the versions i am using, i put here my pom file:*

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sac.panorama.datagrid.console</groupId>
  <artifactId>panorama-grid-console</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>panorama-grid-console</name>
  <url>http://maven.apache.org</url>

  <dependencies>

    <dependency>
     <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <version>2.0.12</version>
    </dependency>

    <dependency>
     <groupId>org.apache.struts</groupId>
      <artifactId>struts2-tiles-plugin</artifactId>
      <version>2.0.12</version>
    </dependency>

    <dependency>
     <groupId>org.apache.tiles</groupId>
      <artifactId>tiles-jsp</artifactId>
      <version>2.1.0</version>
    </dependency>

    <dependency>
      <groupId>com.sac.panorama.datagrid</groupId>
      <artifactId>panorama-grid-monitor-core</artifactId>
      <version>3.0.0-dev-1</version>
      <exclusions>
        <exclusion>
          <artifactId>ognl</artifactId>
          <groupId>ognl</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <repositories>
    <repository>
        <id>gunthers</id>
        <name>Gunther's Archiva</name>
        <url>http://gunthers-pc3:8080/archiva/repository/internal</url>
    </repository>
    <repository>
        <id>central</id>
        <name>IBiblio Maven2 Repository</name>
        <url>http://www.ibiblio.org/maven2</url>
    </repository>
    <repository>
        <id>default</id>
        <name>Default Maven2 Repository</name>
        <url>http://repo1.maven.org/maven2</url>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
        <id>gunthers</id>
        <name>Gunther's Archiva</name>
        <url>http://gunthers-pc3:8080/archiva/repository/internal</url>
    </repository>
  </distributionManagement>

  <build>
        <directory>target</directory>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <outputDirectory>WEB-INF/classes</outputDirectory>
        <testOutputDirectory>WEB-INF/test-classes</testOutputDirectory>
        <finalName>${artifactId}</finalName>
        <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                   <source>1.5</source>
                   <target>1.5</target>
               </configuration>
           </plugin>
            </plugins>
    </build>

</project>

*This is my web.xml file:*

<web-app id="PanoramaGridConsole" version="2.4" xmlns="
http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <!-- Struts 2 Filter -->
    <filter>
        <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>

    <!-- Struts 2 Filter Mapping -->
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- Struts 2 Tiles Listener -->
    <listener>

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

</web-app>

*This is my definitions file:*

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
    <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
        <put-attribute name="title" value="Panorama Grid Console"/>
        <put-attribute name="header" value="/WEB-INF/layout/header.jsp"/>
        <put-attribute name="body" value="/WEB-INF/view/home.jsp"/>
        <put-attribute name="footer" value="/WEB-INF/layout/footer.jsp"/>
    </definition>
</tiles-definitions>

*This is my common.jsp file that defines the layout:

*<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title><tiles:getAsString name="title"/></title>
    </head>
    <body>
        <table>
            <tr>
                <td>
                    <tiles:insertAttribute name="header" />
                </td>
            </tr>
            <tr>
                <td>
                    <tiles:insertAttribute name="body" />
                </td>
            </tr>
            <tr>
                <td>
                    <tiles:insertAttribute name="footer" />
                </td>
            </tr>
        </table>
    </body>
</html>

*This is my struts.xml file:

*<?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>
    <package name="home" extends="struts-default">
        <result-types>
               <result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
          </result-types>
        <action name="Home"
class="com.sac.panorama.datagrid.console.action.HomeAction">
            <result name="success" type="tiles">home.layout</result>
        </action>
    </package>
</struts>


Thanks!!  Please, if anyone can help will be very welcome!

Carlos Curotto.

Re: Struts 2 + Tiles 2

Posted by Alberto Flores <af...@umd.edu>.
Please notice that your error has to do with the common.jsp and not the 
tiles framework...

Carlos Curotto wrote:
> Which versions of Struts and Tiles are you using?
> 
> Thanks!
> 
> On Thu, Oct 30, 2008 at 8:49 AM, Carlos Curotto <ca...@gmail.com>wrote:
> 
>> Hi Marcio, First of all, thanks for the response.
>>
>> I have tried what you told me, to put the result type explicit in the
>> struts.xml file, but i am getting the same exception.  I am thinking that
>> this could be related with the version of struts i am using (2.0.12) or with
>> the version of the struts-tiles plugin (2.0.12), could that be?
>>
>> Here are my files again:
>>
>> <?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>
>>     <package name="home" extends="struts-default">
>>         <result-types>
>>                <result-type name="tiles"
>> class="org.apache.struts2.views.tiles.TilesResult" />
>>           </result-types>
>>         <action name="Home"
>> class="com.sac.panorama.datagrid.console.action.HomeAction">
>>             <result name="success" type="tiles">home.layout</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://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">
>>
>> <tiles-definitions>
>>     <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
>>         <put-attribute name="title" value="Panorama Grid Console"/>
>>         <put-attribute name="header" value="/WEB-INF/layout/header.jsp"/>
>>         <put-attribute name="body" value="/WEB-INF/view/home.jsp"/>
>>         <put-attribute name="footer" value="/WEB-INF/layout/footer.jsp"/>
>>     </definition>
>> </tiles-definitions>
>>
>> tiles template:
>>
>> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
>> http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>>
>> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
>>     <head>
>>         <title><tiles:getAsString name="title"/></title>
>>     </head>
>>     <body>
>>         <table>
>>             <tr>
>>                 <td>
>>                     <tiles:insertAttribute name="header" />
>>                 </td>
>>             </tr>
>>             <tr>
>>                 <td>
>>                     <tiles:insertAttribute name="body" />
>>                 </td>
>>             </tr>
>>             <tr>
>>                 <td>
>>                     <tiles:insertAttribute name="footer" />
>>                 </td>
>>             </tr>
>>         </table>
>>     </body>
>> </html>
>>
>> Any ideas?
>>
>> Thanks in advance,
>>
>> Carlos Curotto.
>>
>>
>> On Wed, Oct 29, 2008 at 8:16 PM, Márcio Gurgel <ma...@gmail.com>wrote:
>>
>>> Hi Carlos,
>>>
>>> I guess that you forgot to put a tiles result type in your struts.xml.
>>> Check if adding this (in your struts.xml) works:
>>>
>>> <package name="tiles-result" extends="struts-default">
>>>        <result-types>
>>>            <result-type name="tiles"
>>> class="org.apache.struts2.views.tiles.TilesResult" />
>>>        </result-types>
>>>    </package>
>>>
>>> *To return a tiles result use this sintax:*
>>>
>>> <action name="abrirPesquisa" method="abrirPesquisa"
>>> class="br.com.sgvdba.actions.pedido.PedidoPesquisaAction">
>>>            <result name="success"
>>> type="tiles">default.pedidoPesquisa</result>
>>>        </action>
>>>
>>>
>>> *My tiles.xml*
>>>
>>> <!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="default"
>>> template="/template/tiles/DefaultTemplate.jsp">
>>>            <put-attribute name="title"     value="SGVDBA" type="string" />
>>>            <put-attribute name="top"
>>> value="/template/tiles/DefaultTop.jsp"/>
>>>            <put-attribute name="menu"
>>> value="/template/tiles/DefaultMenu.jsp"/>
>>>        </definition>
>>>
>>>        <definition name="default.home" extends="default">
>>>            <put-attribute name="body"         value="/view/Home.jsp" />
>>>        </definition>
>>>
>>>        <!-- USUÁRIO -->
>>>        <definition name="default.usu" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/usuario/UsuDadosGerais.jsp" />
>>>        </definition>
>>>
>>>        <definition name="default.usuPesquisa" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/usuario/UsuPesquisa.jsp" />
>>>        </definition>
>>>
>>>        <!-- CLIENTE -->
>>>        <definition name="default.clienteJur" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/cliente/ClienteJur.jsp" />
>>>        </definition>
>>>
>>>        <definition name="default.clienteFsc" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/cliente/ClienteFsc.jsp" />
>>>        </definition>
>>>
>>>        <definition name="default.clientePesquisa" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/cliente/ClientePesquisa.jsp" />
>>>        </definition>
>>>
>>>        <!-- FORNECEDOR -->
>>>        <definition name="default.fornecedor" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/fornecedor/Fornecedor.jsp" />
>>>        </definition>
>>>
>>>        <definition name="default.fornecedorPesquisa" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/fornecedor/FornecedorPesquisa.jsp" />
>>>        </definition>
>>>
>>>        <!-- PRODUTO -->
>>>        <definition name="default.produto" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/produto/Produto.jsp" />
>>>        </definition>
>>>
>>>        <definition name="default.produtoPesquisa" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/produto/ProdutoPesquisa.jsp" />
>>>        </definition>
>>>
>>>        <!-- NFE -->
>>>        <definition name="default.fornecedorNfePesquisa" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/fornecedor/FornecedorNfePesquisa.jsp" />
>>>        </definition>
>>>        <!-- PEDIDO -->
>>>        <definition name="default.pedidoPesquisa" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/pedido/PedidoPesquisa.jsp" />
>>>        </definition>
>>>        <!-- FINANCEIRO -->
>>>        <definition name="default.pedidoFaturaPesquisa" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/financeiro/PedidoFaturaPesquisa.jsp" />
>>>        </definition>
>>>        <definition name="default.pedidoFatura" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/financeiro/PedidoFatura.jsp" />
>>>        </definition>
>>>
>>>        <!-- PORTAL -->
>>>        <definition name="default.portalPedido" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/portal/Pedidos.jsp" />
>>>        </definition>
>>>        <definition name="default.portalProduto" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/portal/Produtos.jsp" />
>>>        </definition>
>>>        <definition name="default.portalNfe" extends="default">
>>>            <put-attribute name="body"
>>> value="/view/portal/Nfes.jsp"
>>> />
>>>        </definition>
>>>
>>>    </tiles-definitions>
>>>
>>>
>>>
>>> Sorry about non-english code /:
>>>
>>> Márcio Gurgel
>>>
>>> 2008/10/29 Carlos Curotto <ca...@gmail.com>
>>>
>>>> Hi everyone,
>>>>
>>>> I am trying to configure Struts 2 version 2.0.12 and Tiles 2.
>>>>
>>>> When i call an action that uses tiles, i am getting this exception:
>>>>
>>>> javax.servlet.ServletException: Error including path
>>>> '/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute
>>>>
>>>>
>>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
>>>>
>>>>
>>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>>>>
>>>> common.jsp is the file that contains the tiles tamplate, here is that
>>> file:
>>>> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
>>>> http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>>>>
>>>> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
>>>>    <body>
>>>>        <table>
>>>>            <tr>
>>>>                <td>
>>>>                    <tiles:insertAttribute name="header" />
>>>>                </td>
>>>>            </tr>
>>>>            <tr>
>>>>                <td>
>>>>                    <tiles:insertAttribute name="body" />
>>>>                </td>
>>>>            </tr>
>>>>            <tr>
>>>>                <td>
>>>>                    <tiles:insertAttribute name="footer" />
>>>>                </td>
>>>>            </tr>
>>>>        </table>
>>>>    </body>
>>>> </html>
>>>>
>>>> also, here is my tiles.xml
>>>>
>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>> <!DOCTYPE tiles-definitions PUBLIC
>>>>       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
>>>>       "http://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">
>>>>
>>>> <tiles-definitions>
>>>>    <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
>>>>        <put name="title" value="Panorama Grid Console"/>
>>>>        <put name="header" value="/WEB-INF/layout/header.jsp"/>
>>>>        <put name="body" value="/WEB-INF/view/home.jsp"/>
>>>>        <put name="footer" value="/WEB-INF/layout/footer.jsp"/>
>>>>    </definition>
>>>> </tiles-definitions>
>>>>
>>>> i have tried with put and put-attribute and i am getting the same
>>> exception
>>>> for both of them.
>>>>
>>>> Finally, here is my web.xml
>>>>
>>>> <web-app id="PanoramaGridConsole" version="2.4" xmlns="
>>>> http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
>>>> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
>>>> http://java.sun.com/xml/ns/j2ee
>>>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>>>>
>>>>    <!-- Struts 2 Filter -->
>>>>    <filter>
>>>>        <filter-name>struts2</filter-name>
>>>>
>>>>
>>> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>>>>    </filter>
>>>>
>>>>    <!-- Struts 2 Filter Mapping -->
>>>>    <filter-mapping>
>>>>        <filter-name>struts2</filter-name>
>>>>        <url-pattern>/*</url-pattern>
>>>>    </filter-mapping>
>>>>
>>>>    <!-- Struts 2 Tiles Listener -->
>>>>    <listener>
>>>>
>>>>
>>>>
>>> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>>>>    </listener>
>>>>
>>>> </web-app>
>>>>
>>>> Am i missing something? is this a bug related to struts 2??? Anyone have
>>>> seen this before?
>>>>
>>>> Thanks in advance,
>>>>
>>>> --
>>>> Carlos Curotto
>>>>
>>>
>>>
>>> --
>>> Márcio Gurgel
>>>
>>
>>
>> --
>> Carlos Curotto
>>
> 
> 
> 

-- 
--
Alberto
http://www.linkedin.com/in/aflores


Re: Struts 2 + Tiles 2

Posted by Carlos Curotto <ca...@gmail.com>.
Which versions of Struts and Tiles are you using?

Thanks!

On Thu, Oct 30, 2008 at 8:49 AM, Carlos Curotto <ca...@gmail.com>wrote:

> Hi Marcio, First of all, thanks for the response.
>
> I have tried what you told me, to put the result type explicit in the
> struts.xml file, but i am getting the same exception.  I am thinking that
> this could be related with the version of struts i am using (2.0.12) or with
> the version of the struts-tiles plugin (2.0.12), could that be?
>
> Here are my files again:
>
> <?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>
>     <package name="home" extends="struts-default">
>         <result-types>
>                <result-type name="tiles"
> class="org.apache.struts2.views.tiles.TilesResult" />
>           </result-types>
>         <action name="Home"
> class="com.sac.panorama.datagrid.console.action.HomeAction">
>             <result name="success" type="tiles">home.layout</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://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">
>
> <tiles-definitions>
>     <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
>         <put-attribute name="title" value="Panorama Grid Console"/>
>         <put-attribute name="header" value="/WEB-INF/layout/header.jsp"/>
>         <put-attribute name="body" value="/WEB-INF/view/home.jsp"/>
>         <put-attribute name="footer" value="/WEB-INF/layout/footer.jsp"/>
>     </definition>
> </tiles-definitions>
>
> tiles template:
>
> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
> http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
>     <head>
>         <title><tiles:getAsString name="title"/></title>
>     </head>
>     <body>
>         <table>
>             <tr>
>                 <td>
>                     <tiles:insertAttribute name="header" />
>                 </td>
>             </tr>
>             <tr>
>                 <td>
>                     <tiles:insertAttribute name="body" />
>                 </td>
>             </tr>
>             <tr>
>                 <td>
>                     <tiles:insertAttribute name="footer" />
>                 </td>
>             </tr>
>         </table>
>     </body>
> </html>
>
> Any ideas?
>
> Thanks in advance,
>
> Carlos Curotto.
>
>
> On Wed, Oct 29, 2008 at 8:16 PM, Márcio Gurgel <ma...@gmail.com>wrote:
>
>> Hi Carlos,
>>
>> I guess that you forgot to put a tiles result type in your struts.xml.
>> Check if adding this (in your struts.xml) works:
>>
>> <package name="tiles-result" extends="struts-default">
>>        <result-types>
>>            <result-type name="tiles"
>> class="org.apache.struts2.views.tiles.TilesResult" />
>>        </result-types>
>>    </package>
>>
>> *To return a tiles result use this sintax:*
>>
>> <action name="abrirPesquisa" method="abrirPesquisa"
>> class="br.com.sgvdba.actions.pedido.PedidoPesquisaAction">
>>            <result name="success"
>> type="tiles">default.pedidoPesquisa</result>
>>        </action>
>>
>>
>> *My tiles.xml*
>>
>> <!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="default"
>> template="/template/tiles/DefaultTemplate.jsp">
>>            <put-attribute name="title"     value="SGVDBA" type="string" />
>>            <put-attribute name="top"
>> value="/template/tiles/DefaultTop.jsp"/>
>>            <put-attribute name="menu"
>> value="/template/tiles/DefaultMenu.jsp"/>
>>        </definition>
>>
>>        <definition name="default.home" extends="default">
>>            <put-attribute name="body"         value="/view/Home.jsp" />
>>        </definition>
>>
>>        <!-- USUÁRIO -->
>>        <definition name="default.usu" extends="default">
>>            <put-attribute name="body"
>> value="/view/usuario/UsuDadosGerais.jsp" />
>>        </definition>
>>
>>        <definition name="default.usuPesquisa" extends="default">
>>            <put-attribute name="body"
>> value="/view/usuario/UsuPesquisa.jsp" />
>>        </definition>
>>
>>        <!-- CLIENTE -->
>>        <definition name="default.clienteJur" extends="default">
>>            <put-attribute name="body"
>> value="/view/cliente/ClienteJur.jsp" />
>>        </definition>
>>
>>        <definition name="default.clienteFsc" extends="default">
>>            <put-attribute name="body"
>> value="/view/cliente/ClienteFsc.jsp" />
>>        </definition>
>>
>>        <definition name="default.clientePesquisa" extends="default">
>>            <put-attribute name="body"
>> value="/view/cliente/ClientePesquisa.jsp" />
>>        </definition>
>>
>>        <!-- FORNECEDOR -->
>>        <definition name="default.fornecedor" extends="default">
>>            <put-attribute name="body"
>> value="/view/fornecedor/Fornecedor.jsp" />
>>        </definition>
>>
>>        <definition name="default.fornecedorPesquisa" extends="default">
>>            <put-attribute name="body"
>> value="/view/fornecedor/FornecedorPesquisa.jsp" />
>>        </definition>
>>
>>        <!-- PRODUTO -->
>>        <definition name="default.produto" extends="default">
>>            <put-attribute name="body"
>> value="/view/produto/Produto.jsp" />
>>        </definition>
>>
>>        <definition name="default.produtoPesquisa" extends="default">
>>            <put-attribute name="body"
>> value="/view/produto/ProdutoPesquisa.jsp" />
>>        </definition>
>>
>>        <!-- NFE -->
>>        <definition name="default.fornecedorNfePesquisa" extends="default">
>>            <put-attribute name="body"
>> value="/view/fornecedor/FornecedorNfePesquisa.jsp" />
>>        </definition>
>>        <!-- PEDIDO -->
>>        <definition name="default.pedidoPesquisa" extends="default">
>>            <put-attribute name="body"
>> value="/view/pedido/PedidoPesquisa.jsp" />
>>        </definition>
>>        <!-- FINANCEIRO -->
>>        <definition name="default.pedidoFaturaPesquisa" extends="default">
>>            <put-attribute name="body"
>> value="/view/financeiro/PedidoFaturaPesquisa.jsp" />
>>        </definition>
>>        <definition name="default.pedidoFatura" extends="default">
>>            <put-attribute name="body"
>> value="/view/financeiro/PedidoFatura.jsp" />
>>        </definition>
>>
>>        <!-- PORTAL -->
>>        <definition name="default.portalPedido" extends="default">
>>            <put-attribute name="body"
>> value="/view/portal/Pedidos.jsp" />
>>        </definition>
>>        <definition name="default.portalProduto" extends="default">
>>            <put-attribute name="body"
>> value="/view/portal/Produtos.jsp" />
>>        </definition>
>>        <definition name="default.portalNfe" extends="default">
>>            <put-attribute name="body"
>> value="/view/portal/Nfes.jsp"
>> />
>>        </definition>
>>
>>    </tiles-definitions>
>>
>>
>>
>> Sorry about non-english code /:
>>
>> Márcio Gurgel
>>
>> 2008/10/29 Carlos Curotto <ca...@gmail.com>
>>
>> > Hi everyone,
>> >
>> > I am trying to configure Struts 2 version 2.0.12 and Tiles 2.
>> >
>> > When i call an action that uses tiles, i am getting this exception:
>> >
>> > javax.servlet.ServletException: Error including path
>> > '/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute
>> >
>> >
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
>> >
>> >
>> >
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>> >
>> >
>> > common.jsp is the file that contains the tiles tamplate, here is that
>> file:
>> >
>> > <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> >
>> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
>> > http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>> >
>> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
>> >    <body>
>> >        <table>
>> >            <tr>
>> >                <td>
>> >                    <tiles:insertAttribute name="header" />
>> >                </td>
>> >            </tr>
>> >            <tr>
>> >                <td>
>> >                    <tiles:insertAttribute name="body" />
>> >                </td>
>> >            </tr>
>> >            <tr>
>> >                <td>
>> >                    <tiles:insertAttribute name="footer" />
>> >                </td>
>> >            </tr>
>> >        </table>
>> >    </body>
>> > </html>
>> >
>> > also, here is my tiles.xml
>> >
>> > <?xml version="1.0" encoding="ISO-8859-1"?>
>> > <!DOCTYPE tiles-definitions PUBLIC
>> >       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
>> >       "http://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">
>> >
>> > <tiles-definitions>
>> >    <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
>> >        <put name="title" value="Panorama Grid Console"/>
>> >        <put name="header" value="/WEB-INF/layout/header.jsp"/>
>> >        <put name="body" value="/WEB-INF/view/home.jsp"/>
>> >        <put name="footer" value="/WEB-INF/layout/footer.jsp"/>
>> >    </definition>
>> > </tiles-definitions>
>> >
>> > i have tried with put and put-attribute and i am getting the same
>> exception
>> > for both of them.
>> >
>> > Finally, here is my web.xml
>> >
>> > <web-app id="PanoramaGridConsole" version="2.4" xmlns="
>> > http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
>> > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
>> > http://java.sun.com/xml/ns/j2ee
>> > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>> >
>> >    <!-- Struts 2 Filter -->
>> >    <filter>
>> >        <filter-name>struts2</filter-name>
>> >
>> >
>> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>> >    </filter>
>> >
>> >    <!-- Struts 2 Filter Mapping -->
>> >    <filter-mapping>
>> >        <filter-name>struts2</filter-name>
>> >        <url-pattern>/*</url-pattern>
>> >    </filter-mapping>
>> >
>> >    <!-- Struts 2 Tiles Listener -->
>> >    <listener>
>> >
>> >
>> >
>> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>> >    </listener>
>> >
>> > </web-app>
>> >
>> > Am i missing something? is this a bug related to struts 2??? Anyone have
>> > seen this before?
>> >
>> > Thanks in advance,
>> >
>> > --
>> > Carlos Curotto
>> >
>>
>>
>>
>> --
>> Márcio Gurgel
>>
>
>
>
> --
> Carlos Curotto
>



-- 
Carlos Curotto

Re: Struts 2 + Tiles 2

Posted by Carlos Curotto <ca...@gmail.com>.
Hi Marcio, First of all, thanks for the response.

I have tried what you told me, to put the result type explicit in the
struts.xml file, but i am getting the same exception.  I am thinking that
this could be related with the version of struts i am using (2.0.12) or with
the version of the struts-tiles plugin (2.0.12), could that be?

Here are my files again:

<?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>
    <package name="home" extends="struts-default">
        <result-types>
               <result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
          </result-types>
        <action name="Home"
class="com.sac.panorama.datagrid.console.action.HomeAction">
            <result name="success" type="tiles">home.layout</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://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
    <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
        <put-attribute name="title" value="Panorama Grid Console"/>
        <put-attribute name="header" value="/WEB-INF/layout/header.jsp"/>
        <put-attribute name="body" value="/WEB-INF/view/home.jsp"/>
        <put-attribute name="footer" value="/WEB-INF/layout/footer.jsp"/>
    </definition>
</tiles-definitions>

tiles template:

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title><tiles:getAsString name="title"/></title>
    </head>
    <body>
        <table>
            <tr>
                <td>
                    <tiles:insertAttribute name="header" />
                </td>
            </tr>
            <tr>
                <td>
                    <tiles:insertAttribute name="body" />
                </td>
            </tr>
            <tr>
                <td>
                    <tiles:insertAttribute name="footer" />
                </td>
            </tr>
        </table>
    </body>
</html>

Any ideas?

Thanks in advance,

Carlos Curotto.

On Wed, Oct 29, 2008 at 8:16 PM, Márcio Gurgel <ma...@gmail.com> wrote:

> Hi Carlos,
>
> I guess that you forgot to put a tiles result type in your struts.xml.
> Check if adding this (in your struts.xml) works:
>
> <package name="tiles-result" extends="struts-default">
>        <result-types>
>            <result-type name="tiles"
> class="org.apache.struts2.views.tiles.TilesResult" />
>        </result-types>
>    </package>
>
> *To return a tiles result use this sintax:*
>
> <action name="abrirPesquisa" method="abrirPesquisa"
> class="br.com.sgvdba.actions.pedido.PedidoPesquisaAction">
>            <result name="success"
> type="tiles">default.pedidoPesquisa</result>
>        </action>
>
>
> *My tiles.xml*
>
> <!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="default"
> template="/template/tiles/DefaultTemplate.jsp">
>            <put-attribute name="title"     value="SGVDBA" type="string" />
>            <put-attribute name="top"
> value="/template/tiles/DefaultTop.jsp"/>
>            <put-attribute name="menu"
> value="/template/tiles/DefaultMenu.jsp"/>
>        </definition>
>
>        <definition name="default.home" extends="default">
>            <put-attribute name="body"         value="/view/Home.jsp" />
>        </definition>
>
>        <!-- USUÁRIO -->
>        <definition name="default.usu" extends="default">
>            <put-attribute name="body"
> value="/view/usuario/UsuDadosGerais.jsp" />
>        </definition>
>
>        <definition name="default.usuPesquisa" extends="default">
>            <put-attribute name="body"
> value="/view/usuario/UsuPesquisa.jsp" />
>        </definition>
>
>        <!-- CLIENTE -->
>        <definition name="default.clienteJur" extends="default">
>            <put-attribute name="body"
> value="/view/cliente/ClienteJur.jsp" />
>        </definition>
>
>        <definition name="default.clienteFsc" extends="default">
>            <put-attribute name="body"
> value="/view/cliente/ClienteFsc.jsp" />
>        </definition>
>
>        <definition name="default.clientePesquisa" extends="default">
>            <put-attribute name="body"
> value="/view/cliente/ClientePesquisa.jsp" />
>        </definition>
>
>        <!-- FORNECEDOR -->
>        <definition name="default.fornecedor" extends="default">
>            <put-attribute name="body"
> value="/view/fornecedor/Fornecedor.jsp" />
>        </definition>
>
>        <definition name="default.fornecedorPesquisa" extends="default">
>            <put-attribute name="body"
> value="/view/fornecedor/FornecedorPesquisa.jsp" />
>        </definition>
>
>        <!-- PRODUTO -->
>        <definition name="default.produto" extends="default">
>            <put-attribute name="body"
> value="/view/produto/Produto.jsp" />
>        </definition>
>
>        <definition name="default.produtoPesquisa" extends="default">
>            <put-attribute name="body"
> value="/view/produto/ProdutoPesquisa.jsp" />
>        </definition>
>
>        <!-- NFE -->
>        <definition name="default.fornecedorNfePesquisa" extends="default">
>            <put-attribute name="body"
> value="/view/fornecedor/FornecedorNfePesquisa.jsp" />
>        </definition>
>        <!-- PEDIDO -->
>        <definition name="default.pedidoPesquisa" extends="default">
>            <put-attribute name="body"
> value="/view/pedido/PedidoPesquisa.jsp" />
>        </definition>
>        <!-- FINANCEIRO -->
>        <definition name="default.pedidoFaturaPesquisa" extends="default">
>            <put-attribute name="body"
> value="/view/financeiro/PedidoFaturaPesquisa.jsp" />
>        </definition>
>        <definition name="default.pedidoFatura" extends="default">
>            <put-attribute name="body"
> value="/view/financeiro/PedidoFatura.jsp" />
>        </definition>
>
>        <!-- PORTAL -->
>        <definition name="default.portalPedido" extends="default">
>            <put-attribute name="body"
> value="/view/portal/Pedidos.jsp" />
>        </definition>
>        <definition name="default.portalProduto" extends="default">
>            <put-attribute name="body"
> value="/view/portal/Produtos.jsp" />
>        </definition>
>        <definition name="default.portalNfe" extends="default">
>            <put-attribute name="body"         value="/view/portal/Nfes.jsp"
> />
>        </definition>
>
>    </tiles-definitions>
>
>
>
> Sorry about non-english code /:
>
> Márcio Gurgel
>
> 2008/10/29 Carlos Curotto <ca...@gmail.com>
>
> > Hi everyone,
> >
> > I am trying to configure Struts 2 version 2.0.12 and Tiles 2.
> >
> > When i call an action that uses tiles, i am getting this exception:
> >
> > javax.servlet.ServletException: Error including path
> > '/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute
> >
> >
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
> >
> >
> >
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
> >
> >
> > common.jsp is the file that contains the tiles tamplate, here is that
> file:
> >
> > <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
> > http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> >
> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> >    <body>
> >        <table>
> >            <tr>
> >                <td>
> >                    <tiles:insertAttribute name="header" />
> >                </td>
> >            </tr>
> >            <tr>
> >                <td>
> >                    <tiles:insertAttribute name="body" />
> >                </td>
> >            </tr>
> >            <tr>
> >                <td>
> >                    <tiles:insertAttribute name="footer" />
> >                </td>
> >            </tr>
> >        </table>
> >    </body>
> > </html>
> >
> > also, here is my tiles.xml
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <!DOCTYPE tiles-definitions PUBLIC
> >       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
> >       "http://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">
> >
> > <tiles-definitions>
> >    <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
> >        <put name="title" value="Panorama Grid Console"/>
> >        <put name="header" value="/WEB-INF/layout/header.jsp"/>
> >        <put name="body" value="/WEB-INF/view/home.jsp"/>
> >        <put name="footer" value="/WEB-INF/layout/footer.jsp"/>
> >    </definition>
> > </tiles-definitions>
> >
> > i have tried with put and put-attribute and i am getting the same
> exception
> > for both of them.
> >
> > Finally, here is my web.xml
> >
> > <web-app id="PanoramaGridConsole" version="2.4" xmlns="
> > http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> > http://java.sun.com/xml/ns/j2ee
> > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> >
> >    <!-- Struts 2 Filter -->
> >    <filter>
> >        <filter-name>struts2</filter-name>
> >
> >
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
> >    </filter>
> >
> >    <!-- Struts 2 Filter Mapping -->
> >    <filter-mapping>
> >        <filter-name>struts2</filter-name>
> >        <url-pattern>/*</url-pattern>
> >    </filter-mapping>
> >
> >    <!-- Struts 2 Tiles Listener -->
> >    <listener>
> >
> >
> >
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
> >    </listener>
> >
> > </web-app>
> >
> > Am i missing something? is this a bug related to struts 2??? Anyone have
> > seen this before?
> >
> > Thanks in advance,
> >
> > --
> > Carlos Curotto
> >
>
>
>
> --
> Márcio Gurgel
>



-- 
Carlos Curotto

Re: Struts 2 + Tiles 2

Posted by Márcio Gurgel <ma...@gmail.com>.
Hi Carlos,

I guess that you forgot to put a tiles result type in your struts.xml.
Check if adding this (in your struts.xml) works:

<package name="tiles-result" extends="struts-default">
        <result-types>
            <result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
        </result-types>
    </package>

*To return a tiles result use this sintax:*

<action name="abrirPesquisa" method="abrirPesquisa"
class="br.com.sgvdba.actions.pedido.PedidoPesquisaAction">
            <result name="success"
type="tiles">default.pedidoPesquisa</result>
        </action>


*My tiles.xml*

<!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="default"
template="/template/tiles/DefaultTemplate.jsp">
            <put-attribute name="title"     value="SGVDBA" type="string" />
            <put-attribute name="top"
value="/template/tiles/DefaultTop.jsp"/>
            <put-attribute name="menu"
value="/template/tiles/DefaultMenu.jsp"/>
        </definition>

        <definition name="default.home" extends="default">
            <put-attribute name="body"         value="/view/Home.jsp" />
        </definition>

        <!-- USUÁRIO -->
        <definition name="default.usu" extends="default">
            <put-attribute name="body"
value="/view/usuario/UsuDadosGerais.jsp" />
        </definition>

        <definition name="default.usuPesquisa" extends="default">
            <put-attribute name="body"
value="/view/usuario/UsuPesquisa.jsp" />
        </definition>

        <!-- CLIENTE -->
        <definition name="default.clienteJur" extends="default">
            <put-attribute name="body"
value="/view/cliente/ClienteJur.jsp" />
        </definition>

        <definition name="default.clienteFsc" extends="default">
            <put-attribute name="body"
value="/view/cliente/ClienteFsc.jsp" />
        </definition>

        <definition name="default.clientePesquisa" extends="default">
            <put-attribute name="body"
value="/view/cliente/ClientePesquisa.jsp" />
        </definition>

        <!-- FORNECEDOR -->
        <definition name="default.fornecedor" extends="default">
            <put-attribute name="body"
value="/view/fornecedor/Fornecedor.jsp" />
        </definition>

        <definition name="default.fornecedorPesquisa" extends="default">
            <put-attribute name="body"
value="/view/fornecedor/FornecedorPesquisa.jsp" />
        </definition>

        <!-- PRODUTO -->
        <definition name="default.produto" extends="default">
            <put-attribute name="body"
value="/view/produto/Produto.jsp" />
        </definition>

        <definition name="default.produtoPesquisa" extends="default">
            <put-attribute name="body"
value="/view/produto/ProdutoPesquisa.jsp" />
        </definition>

        <!-- NFE -->
        <definition name="default.fornecedorNfePesquisa" extends="default">
            <put-attribute name="body"
value="/view/fornecedor/FornecedorNfePesquisa.jsp" />
        </definition>
        <!-- PEDIDO -->
        <definition name="default.pedidoPesquisa" extends="default">
            <put-attribute name="body"
value="/view/pedido/PedidoPesquisa.jsp" />
        </definition>
        <!-- FINANCEIRO -->
        <definition name="default.pedidoFaturaPesquisa" extends="default">
            <put-attribute name="body"
value="/view/financeiro/PedidoFaturaPesquisa.jsp" />
        </definition>
        <definition name="default.pedidoFatura" extends="default">
            <put-attribute name="body"
value="/view/financeiro/PedidoFatura.jsp" />
        </definition>

        <!-- PORTAL -->
        <definition name="default.portalPedido" extends="default">
            <put-attribute name="body"
value="/view/portal/Pedidos.jsp" />
        </definition>
        <definition name="default.portalProduto" extends="default">
            <put-attribute name="body"
value="/view/portal/Produtos.jsp" />
        </definition>
        <definition name="default.portalNfe" extends="default">
            <put-attribute name="body"         value="/view/portal/Nfes.jsp"
/>
        </definition>

    </tiles-definitions>



Sorry about non-english code /:

Márcio Gurgel

2008/10/29 Carlos Curotto <ca...@gmail.com>

> Hi everyone,
>
> I am trying to configure Struts 2 version 2.0.12 and Tiles 2.
>
> When i call an action that uses tiles, i am getting this exception:
>
> javax.servlet.ServletException: Error including path
> '/WEB-INF/layout/common.jsp'. org/apache/tiles/ListAttribute
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
>
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>
>
> common.jsp is the file that contains the tiles tamplate, here is that file:
>
> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
> http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
>    <body>
>        <table>
>            <tr>
>                <td>
>                    <tiles:insertAttribute name="header" />
>                </td>
>            </tr>
>            <tr>
>                <td>
>                    <tiles:insertAttribute name="body" />
>                </td>
>            </tr>
>            <tr>
>                <td>
>                    <tiles:insertAttribute name="footer" />
>                </td>
>            </tr>
>        </table>
>    </body>
> </html>
>
> also, here is my tiles.xml
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE tiles-definitions PUBLIC
>       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
>       "http://jakarta.apache.org/struts/dtds/tiles-config_2_0.dtd">
>
> <tiles-definitions>
>    <definition name="home.layout" template="/WEB-INF/layout/common.jsp">
>        <put name="title" value="Panorama Grid Console"/>
>        <put name="header" value="/WEB-INF/layout/header.jsp"/>
>        <put name="body" value="/WEB-INF/view/home.jsp"/>
>        <put name="footer" value="/WEB-INF/layout/footer.jsp"/>
>    </definition>
> </tiles-definitions>
>
> i have tried with put and put-attribute and i am getting the same exception
> for both of them.
>
> Finally, here is my web.xml
>
> <web-app id="PanoramaGridConsole" version="2.4" xmlns="
> http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
>    <!-- Struts 2 Filter -->
>    <filter>
>        <filter-name>struts2</filter-name>
>
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>    </filter>
>
>    <!-- Struts 2 Filter Mapping -->
>    <filter-mapping>
>        <filter-name>struts2</filter-name>
>        <url-pattern>/*</url-pattern>
>    </filter-mapping>
>
>    <!-- Struts 2 Tiles Listener -->
>    <listener>
>
>
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>    </listener>
>
> </web-app>
>
> Am i missing something? is this a bug related to struts 2??? Anyone have
> seen this before?
>
> Thanks in advance,
>
> --
> Carlos Curotto
>



-- 
Márcio Gurgel