You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Roshni Basu <ro...@gmail.com> on 2009/07/06 07:00:55 UTC

Issues while reusing the old tags- Please help

Hi,
I am migrating from Tiles1 to Tiles2. I'm using tiles-compat.jar inorder to
reuse the Tiles1 definition.
I have removed the tiles plugin from struts-config.xml.
Here is the snippet from web.xml
<servlet-name>tiles</servlet-name>
      
<servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
       <init-param>
               <param-name>
                      
org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
              
<param-value>/WEB-INF/config/layout/tile2-console-default-definition.xml,/WEB-INF/config/tile2-IMSConsole-defs.xml,/WEB-INF/config/tile1-definition.xml,/WEB-INF/config/tile2-defs.xml</param-value>
       </init-param>
       <init-param>
       
<param-name>org.apache.tiles.definition.DefinitionsReader</param-name>
       
<param-value>org.apache.tiles.compat.definition.digester.CompatibilityDigesterDefinitionsReader</param-value>
   </init-param>
   <init-param>
    
<param-name>org.apache.tiles.renderer.impl.BasicRendererFactory.TYPE_RENDERERS</param-name>
         <param-value>
          string,org.apache.tiles.renderer.impl.StringAttributeRenderer;
         
definition,org.apache.tiles.renderer.impl.DefinitionAttributeRenderer;
          
template,org.apache.tiles.renderer.impl.TemplateAttributeRenderer;
          page,org.apache.tiles.renderer.impl.TemplateAttributeRenderer
       </param-value>
   </init-param>
       <load-on-startup>2</load-on-startup>
</servlet>

I get the following exception in the jsp:
javax.servlet.jsp.JspException: Can't get definitions factory from context.
       at
org.apache.struts.tiles.taglib.InsertTag.processDefinitionName(InsertTag.java:632)
       at
org.apache.struts.tiles.taglib.InsertTag.createTagHandler(InsertTag.java:529)
       at
org.apache.struts.tiles.taglib.InsertTag.doStartTag(InsertTag.java:479)
       at
org.apache.jsp.view.Index_jsp._jspx_meth_tiles_insert_0(Index_jsp.java:113)
       at org.apache.jsp.view.Index_jsp._jspService(Index_jsp.java:90)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
       at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at
com.rsa.ui.common.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:55)
       at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
       at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at
com.rsa.ui.common.security.csrf.CSRFFilter.doFilterInternal(CSRFFilter.java:85)
       at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
       at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
       at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Thread.java:595)
How do I exactly solve this?

-- 
View this message in context: http://www.nabble.com/Issues-while-reusing-the-old-tags--Please-help-tp24349833p24349833.html
Sent from the tiles users mailing list archive at Nabble.com.


Re: Issues while reusing the old tags- Please help

Posted by Antonio Petrelli <an...@gmail.com>.
2009/7/6 Antonio Petrelli <an...@gmail.com>:
> 2009/7/6 Roshni Basu <ro...@gmail.com>:
>>
>>  Does it mean that using tiles-compat.jar we can only use the old definitions
>> i.e the xml files (tiles-compat.jar in my case)and we are supposed to change
>> the jsp's with the tiles2 tags? Cannot we  use the tiles1 tags in jsps?
>
> Nope.

I meant: you can use old XML files, but not old JSP tags.

Antonio

Re: Issues while reusing the old tags- Please help

Posted by Roshni Basu <ro...@gmail.com>.
Thanks Antonio.
Yeah jsp change is easy.
But I was thinking that I could use the old tags as well.:)


Antonio Petrelli-3 wrote:
> 
> 2009/7/6 Roshni Basu <ro...@gmail.com>:
>>
>>  Does it mean that using tiles-compat.jar we can only use the old
>> definitions
>> i.e the xml files (tiles-compat.jar in my case)and we are supposed to
>> change
>> the jsp's with the tiles2 tags? Cannot we  use the tiles1 tags in jsps?
> 
> Nope. This was a hard choice at the time of development. I was going
> to create a tag layer that would be compatible with Tiles 1, but, in
> fact, I would have to write *deliberately* bad code.
> So you have to migrate at least the JSP part. It is not hard to do,
> the page that I sent you should be enough.
> 
> Antonio
> 
> 

-- 
View this message in context: http://www.nabble.com/Issues-while-reusing-the-old-tags--Please-help-tp24349833p24351492.html
Sent from the tiles users mailing list archive at Nabble.com.


Re: Issues while reusing the old tags- Please help

Posted by Antonio Petrelli <an...@gmail.com>.
2009/7/6 Roshni Basu <ro...@gmail.com>:
>
>  Does it mean that using tiles-compat.jar we can only use the old definitions
> i.e the xml files (tiles-compat.jar in my case)and we are supposed to change
> the jsp's with the tiles2 tags? Cannot we  use the tiles1 tags in jsps?

Nope. This was a hard choice at the time of development. I was going
to create a tag layer that would be compatible with Tiles 1, but, in
fact, I would have to write *deliberately* bad code.
So you have to migrate at least the JSP part. It is not hard to do,
the page that I sent you should be enough.

Antonio

Re: Issues while reusing the old tags- Please help

Posted by Roshni Basu <ro...@gmail.com>.
 Does it mean that using tiles-compat.jar we can only use the old definitions
i.e the xml files (tiles-compat.jar in my case)and we are supposed to change
the jsp's with the tiles2 tags? Cannot we  use the tiles1 tags in jsps?

Antonio Petrelli-3 wrote:
> 
> 2009/7/6 Roshni Basu <ro...@gmail.com>:
>> javax.servlet.jsp.JspException: Can't get definitions factory from
>> context.
>>       at
>> org.apache.struts.tiles.taglib.InsertTag.processDefinitionName(InsertTag.java:632)
> 
> It seems that you are using the old version of JSP tags. See:
> http://tiles.apache.org/framework/migration/tags.html
> 
> Antonio
> 
> 

-- 
View this message in context: http://www.nabble.com/Issues-while-reusing-the-old-tags--Please-help-tp24349833p24351036.html
Sent from the tiles users mailing list archive at Nabble.com.


Re: Issues while reusing the old tags- Please help

Posted by Antonio Petrelli <an...@gmail.com>.
2009/7/6 Roshni Basu <ro...@gmail.com>:
> javax.servlet.jsp.JspException: Can't get definitions factory from context.
>       at
> org.apache.struts.tiles.taglib.InsertTag.processDefinitionName(InsertTag.java:632)

It seems that you are using the old version of JSP tags. See:
http://tiles.apache.org/framework/migration/tags.html

Antonio