tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venu Gopalan <venugopala...@yahoo.com.INVALID>
Subject Re: Struts 1 / Tile 2 integration issue
Date Fri, 17 Mar 2017 18:28:11 GMT
When I changed <tiles:insertAttribute name="/baseLayout.jsp" flush="true">        <tiles:putAttribute
name="title" value="Tiles Example"/>  TO         <tiles:insertTemplate template="/baseLayout.jsp"
flush="true">            <tiles:putAttribute name="title" value="Tiles Example"/>
Finally the page loaded. Thank you.
Actually I need to upgrade a huge and very old govt application to spring 4.1.x and Hibernate
4 which intern forced to change Tiles 1.x to 2.x. As the application use Struts1.x, it became
bit difficult as nigrating to Struts 2.x is a huge task which will not fit into the time frame.
So before implementing the struts 1.x with Tiles 2 in the application directly, I was trying
to convert a sample struts1.x/Tiles 1.x project to Struts 1.x/Tiles 2.x. That is where all
this issues poped up. 
Back to the issue:
Once the page is loaded, there was a validator issue while clicking on a link. upn the server
startup itself it was displaying an error:java.lang.NoSuchMethodError: org.apache.commons.validator.ValidatorResources.<init>([Ljava/net/URL;)V
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:251) at
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:174) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:891)
when I changed the commons-validator.jar TO commons-validator-1.4.0,jar, that error went off.
But while clicking the link it displays a message in the console as below:
:-8000-00000000000004f5,0] [APP: sampleTiles2] Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory:-8000-00000000000004f5,0]
[APP: sampleTiles2] Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory:-8000-00000000000004f5,0]
[APP: sampleTiles2] Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory00-00000000000004f5,0]
[APP: sampleTiles2] Cannot find TilesRequestContextFactory class org.apache.tiles.portlet.context.PortletTilesRequestContextFactory00-00000000000004f5,0]
[APP: sampleTiles2] Unable to find configured definition '/WEB-INF/tiles.xml' [APP: sampleTiles2]
The created container is not instance of KeyedDefinitionsFactoryTilesContainer and cannot
be configured correctly
My tiles-defs.xml
    <definition name="base.definition" template="/baseLayout.jsp">        <put-attribute
name="title"  value="Tiles Example" />        <put-attribute name="header" value="/header.jsp"
/>        <put-attribute name="menu"   value="/menu.jsp" />        <put-attribute
name="body"   value="/body.jsp" />        <put-attribute name="footer" value="/footer.jsp"
/>            </definition>    <definition name="friends" extends="base.definition"> 
      <put-attribute name="title" value="Friends" />        <put-attribute
name="body" value="/friends.jsp" />    </definition>    <definition name="office"
extends="base.definition">        <put-attribute name="title" value="The Office"
/>        <put-attribute name="body" value="/office.jsp" />    </definition>

Any thoughts? :) Once again thank you for your big chink of time for this issue.
ThanksVenu

 

    On Friday, 17 March 2017 12:50 PM, Torsten Krah <krah.tm@gmail.com> wrote:
 

 This seems kind of strange:

https://tiles.apache.org/framework/tiles-jsp/tlddoc/tiles/insertAttribute.html

/baseLayout.jsp is not a name of an attribute but the template name of
the definition, looks suspicious to me.

Maybe you mean:

https://tiles.apache.org/framework/tiles-jsp/tlddoc/tiles/insertTemplate.html

If you look here:

https://tiles.apache.org/framework/tiles-jsp/tlddoc/tiles/tld-summary.html

This looks like the one you're looking for:

<tiles:insertTemplate template="/basic/myLayout.jsp" flush="true">
                  <tiles:putAttribute name="title" value="My first
page" />
                  <tiles:putAttribute name="header"
value="/common/header.jsp" />
                  <tiles:putAttribute name="footer"
value="/common/footer.jsp" />
                  <tiles:putAttribute name="menu"
value="/basic/menu.jsp" />
                  <tiles:putAttribute name="body"
value="/basic/helloBody.jsp" />
                </tiles:insertTemplate>



Could you double check that.

kind regards

Torsten

Am Freitag, den 17.03.2017, 16:07 +0000 schrieb Venu Gopalan:
> <tiles:insertAttribute name="/baseLayout.jsp" flush="true">
> <tiles:putAttribute name="title" value="Tiles Example"/>
> <tiles:putAttribute name="header" value="/header.jsp" />
> <tiles:putAttribute name="menu" value="/menu.jsp" />
> <tiles:putAttribute name="body" value="/body.jsp" />
> <tiles:putAttribute name="footer" value="/footer.jsp" />
> </tiles:insertAttribute>




   
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message