I solve this problem by creatig duplicate tiles.xml (tiles 2 configuration) which will be used by Struts2 and the other tiles-defs by struts1. The other change i have to made is to duplicate my layout.jsp for tiles 2. And then every thing is working fine.

On 24-05-2011 23:29, Sachin Lale wrote:
Hi,
I might not understand what null definition means. Also i don't want to loose the current flow of struts 1.1 (using TilesPlugin) and also Struts2 to work using old tiles definition. I am using tile 2.2.2 and followed the instructions given on http://tiles.apache.org/framework/migration/configuration.html#Reusing_old_Tiles_configuration_files got NullPointerException org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs. So i rename my my tiles-defs.xml fiel to tiles.xml and got the same exception as given below.
org.apache.tiles.impl.InvalidTemplateException: Cannot render a null template
Thanks for help.

Best regards,
Sachin


On 24-05-2011 00:12, Martin Gainty wrote:
it seems you are supplying a null template definition  e.g.
<%@ taglib uri="http://struts.apache.org/tags-tiles";  prefix="tiles" %>
<definition name="templateDefinition" path="/layout.jsp">
   <put name="title"  value="This is the title." />
   <put name="header" value="header.jsp" />
   <put name="body"   value="body.jsp" />
</definition>
WEB-INF/struts-config.xml
<!-- To use tiles-plugin, download and add the Tiles jar to your WEB-INF/lib
      directory then uncomment the plugin definition below.
-->

<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
                       value="/WEB-INF/tiles-defs.xml" />s
<set-property property="moduleAware" value="true" />
</plug-in>

to implement tiles in struts2.x use org.apache.struts2.tiles.listener.StrutsTilesListener
web.xml would contain
<listener>
<listener-class>
            org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>

Martin Gainty
______________________________________________
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.





> Date: Mon, 23 May 2011 22:48:01 +0530
> From: sachin.l...@krishagni.com
> To: user@struts.apache.org
> Subject: Upgrading Struts 1.1 to Struts 2 with tiles
>
> Hi,
> I want to upgrade my application to Struts 2.2.3 from struts 1.1. I want
> to migrate this on shared resource basis i.e. running both Struts1 and
> struts2 in parallel each handling different action extension (*.action
> and *.do). Though i could successfully created the Struts2 action class
> and request is getting routed correctly but i am facing problems with
> re-using struts-tiles. I added below lines in web.xml
> <filter>
> <filter-name>struts2</filter-name>
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
> </filter>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>*.action</url-pattern>
> </filter-mapping>
> <context-param>
> <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
> <param-value>/WEB-INF/tiles-defs.xml</param-value>
> </context-param>
> <listener>
> <listener-class>org.apache.tiles.extras.complete.CompleteAutoloadTilesListener</listener-class>
> </listener>
>
> But it is throwing below action while forwarding request from struts2
> action to tile.
>
> org.apache.tiles.impl.InvalidTemplateException: Cannot render a null template > org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:51) > org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106) > org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670) > org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690) > org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644) > org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627) > org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321) > org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105) > org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186) > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373) > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277) > com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) > com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
>
>
>
> After couple of search i found there is a struts1 -tiles2 plugin
> available but it seems to be compatible with struts1.3.
>
> Any help or pointer would be helpful.
> Thanks in advance
>
> Best regards,
> Sachin Lale

Reply via email to