struts.xml 'tiles' result types not resolving (Struts2/Tiles2)

I've been struggling with the resolution of Tiles 2 result types in my struts.xml.  Since it's as simple as that and my ability to describe it any better is poor I will simply paste and attach screenshots of the related code and configurations.  Notice the red text in the struts.xml code below - that is the issue.  It does not resolve.  I am using IDEA 8.1.3.  Any help is greatly appreciated!

/web/WEB-INF/web.xml
<context-param>
     <param-name>tilesDefinitions</param-name>
     <param-value>/WEB-INF/tiles.xml</param-value>
</context-param>

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

/src/struts.xml
<struts>
    <constant name="struts.devMode" value="true"/>

    <package name="default" namespace="/" extends="struts-default">

        <result-types>
            <result-type name="tiles" default="true"/>
        </result-types>


        <action name="Register">
            <result>account.registration</result>
        </action>

        <action name="Registration" >
            <result>/Welcome.jsp</result>
            <result name="input">/Registration.jsp</result>
        </action>

    </package>
</struts>

/web/WEB-INF/tiles.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
       "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
<tiles-definitions>
  <definition name="account.registration" template="/layouts/basic.jsp">
    <put-attribute name="title" value="Tiles tutorial homepage" />
    <put-attribute name="header" value="/tiles/header.jsp" />
    <put-attribute name="menu" value="/tiles/menu.jsp" />
    <put-attribute name="body" value="/tiles/Registration_body.jsp" />
    <put-attribute name="footer" value="/tiles/footer.jsp" />
  </definition>
</tiles-definitions>

Dave K.



Attachment(s):
tiles-issue.gif
15 comments
Comment actions Permalink

Is plugin "Struts Assistant" enabled?

0
Comment actions Permalink

Nope, just the Struts 2 plugin.

0
Comment actions Permalink

You'll need to enable Struts Assistant plugin additionally for Tiles support.

0
Comment actions Permalink

Ah yes, ok.  I had tried that earlier but in 8.1.3, and 9 M1 this failed for the following reason.

error.gif

Just a quick update - I tried grabbing several different versions of Struts Assistant and the ones above 1.07 were incompatible (1.07 is what I have).  The others all throw this message.

Dave

0
Comment actions Permalink

I'm not sure what the policy is on bumping here but *bump*.  I've temporarily disabled my struts model validation for the time being but this is still an issue.

Dave K.

0
Comment actions Permalink

Did you figure out this issue? If no, let me know.

0
Comment actions Permalink

Nope, just going to go ahead with it disabled until a fix comes along.

0
Comment actions Permalink

does it work if you specify "type" explicitly?

<result type="tiles">account.registration</result>

0
Comment actions Permalink

I was hoping so but it does not.

0
Comment actions Permalink

OK, I reproduced your problem with 8.1.3 - but everything works as expected with Maia EAP, you might want to try it (http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP)

It seems the problem is buried somewhere in Tiles support in 8.1.3 .. unfortunately I'm lacking time to verify this right now

0
Comment actions Permalink

Thanks Yann, I'll give it a shot after work today.

Worth noting though is that I tried using Maia (maybe not the version you posted) and I'd crash because of a conflict with the Struts 2 Assistant plugin I think.  I'll try later and provide the details.

0
Comment actions Permalink

Make sure you're only using "original" plugin versions of both Struts2/Struts Assistant plugins


0
Comment actions Permalink

So using the build of Maia that you posted works when explicitly using types="tiles".  Appreciate the help, now should I mark that as a valid answer?

0
Comment actions Permalink

Hi David Klawitter,

Try to update following in your struts.xml

<action name="Register">
            <result type="tiles">account.registration</result>
        </action>

Now you need to define the 'tiles' type in the struts.xml. Look at the top of following struts.xml.

<struts>
    <package name="/mainpage"  extends="struts-default">
        <result-types>
        <result-type name="tiles" />
        </result-types>

....
<action name="Register">
            <result type="tiles">account.registration</result>
        </action>
...

    </package>
</struts>

0
Comment actions Permalink

I don't think so, because it should work without explicitly settings type="tiles". I've filed http://www.jetbrains.net/jira/browse/STRPL-109, please watch it for progress.

Thanks for reporting,

Yann

0

Please sign in to leave a comment.