You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Hernán <he...@gmail.com> on 2010/07/28 23:48:10 UTC
Struts 2 Tiles 2 Freemarker Integration
As I try to configure freemarker with struts 2 when I add the method
registerAttributeRenderers to a class that extends
BasicTilesContainerFactory I get an error I cannot resolve.
package ro.tiles;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.tiles.TilesApplicationContext;
import org.apache.tiles.TilesContainer;
import org.apache.tiles.context.TilesRequestContextFactory;
import org.apache.tiles.evaluator.AttributeEvaluatorFactory;
import org.apache.tiles.factory.BasicTilesContainerFactory;
import org.apache.tiles.freemarker.renderer.FreeMarkerAttributeRenderer;
import org.apache.tiles.renderer.impl.BasicRendererFactory;
public class RoTilesFactory extends BasicTilesContainerFactory {
@Override
protected List<URL> getSourceURLs(TilesApplicationContext
tilesApplicationContext,
TilesRequestContextFactory tilesRequestContextFactory) {
List<URL> urls = null;
try {
urls = new ArrayList<URL>();
urls.add(tilesApplicationContext.getResource("/WEB-INF/tiles_en_US.xml"));
} catch(Exception exception) {
}
return urls;
}
@Override
protected void registerAttributeRenderers(
BasicRendererFactory rendererFactory,
TilesApplicationContext applicationContext,
TilesRequestContextFactory contextFactory,
TilesContainer container,
AttributeEvaluatorFactory attributeEvaluatorFactory)
{
FreeMarkerAttributeRenderer freemarkerRenderer = new
FreeMarkerAttributeRenderer();
freemarkerRenderer.setApplicationContext(applicationContext);
freemarkerRenderer.setAttributeEvaluatorFactory(attributeEvaluatorFactory);
freemarkerRenderer.setRequestContextFactory(contextFactory);
freemarkerRenderer.setParameter("TemplatePath", "/WEB-INF/ftl/");
freemarkerRenderer.setParameter("NoCache", "true");
freemarkerRenderer.setParameter("ContentType", "text/html");
freemarkerRenderer.setParameter("template_update_delay", "0");
freemarkerRenderer.setParameter("default_encoding", "ISO-8859-1");
freemarkerRenderer.setParameter("number_format", "0.##########");
freemarkerRenderer.commit();
rendererFactory.registerRenderer("freemarker", freemarkerRenderer);
}
}
org.apache.tiles.reflect.CannotInstantiateObjectException: Unable to resolve
factory class: 'definition'
at org.apache.tiles.reflect.ClassUtil.instantiate(ClassUtil.java:109)
at org.apache.tiles.reflect.ClassUtil.instantiate(ClassUtil.java:82)
at
org.apache.tiles.renderer.impl.BasicRendererFactory.getRenderer(BasicRendererFactory.java:181)
at
org.apache.tiles.factory.BasicTilesContainerFactory.createDefaultAttributeRenderer(BasicTilesContainerFactory.java:438)
at
org.apache.tiles.factory.BasicTilesContainerFactory.createRendererFactory(BasicTilesContainerFactory.java:413)
at
org.apache.tiles.factory.BasicTilesContainerFactory.createContainer(BasicTilesContainerFactory.java:111)
at
org.apache.tiles.startup.AbstractTilesInitializer.createContainer(AbstractTilesInitializer.java:124)
at
org.apache.tiles.startup.AbstractTilesInitializer.initialize(AbstractTilesInitializer.java:70)
at
org.apache.tiles.web.startup.AbstractTilesInitializerServlet.init(AbstractTilesInitializerServlet.java:61)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.ClassNotFoundException: definition
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.tiles.reflect.ClassUtil.getClass(ClassUtil.java:67)
at org.apache.tiles.reflect.ClassUtil.instantiate(ClassUtil.java:103)
... 26 more
Jul 28, 2010 6:35:17 PM org.apache.catalina.core.StandardContext
loadOnStartup
SEVERE: Servlet /RemOpt threw load() exception
java.lang.ClassNotFoundException: definition
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.tiles.reflect.ClassUtil.getClass(ClassUtil.java:67)
at org.apache.tiles.reflect.ClassUtil.instantiate(ClassUtil.java:103)
at org.apache.tiles.reflect.ClassUtil.instantiate(ClassUtil.java:82)
at
org.apache.tiles.renderer.impl.BasicRendererFactory.getRenderer(BasicRendererFactory.java:181)
at
org.apache.tiles.factory.BasicTilesContainerFactory.createDefaultAttributeRenderer(BasicTilesContainerFactory.java:438)
at
org.apache.tiles.factory.BasicTilesContainerFactory.createRendererFactory(BasicTilesContainerFactory.java:413)
at
org.apache.tiles.factory.BasicTilesContainerFactory.createContainer(BasicTilesContainerFactory.java:111)
at
org.apache.tiles.startup.AbstractTilesInitializer.createContainer(AbstractTilesInitializer.java:124)
at
org.apache.tiles.startup.AbstractTilesInitializer.initialize(AbstractTilesInitializer.java:70)
at
org.apache.tiles.web.startup.AbstractTilesInitializerServlet.init(AbstractTilesInitializerServlet.java:61)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
--
Hernán
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by Antonio Petrelli <an...@gmail.com>.
2010/7/29 heamaya <he...@gmail.com>:
>
> Thank you, the exception has disappeared! Problem solved. Now I get a
> message:
> HTTP Status 405 - HTTP method GET is not supported by this URL... But it
> seems this is a struts 2 problem and not a tiles 2 problem, is this correct?
It's *really* strange, what is the URL that causes the problem?
> When I write a definition in the xml file can it be a freemarker template?
>
> <definition name="administratorBase"
> template="/ftl/administrator/layout.ftl" >
> <put-attribute name="header" value="/ftl/header.ftl" type="freemarker" />
> <put-attribute name="menu" value="/ftl/administrator/menu.ftl"
> type="freemarker" />
> <put-attribute name="footer" value="/ftl/footer.ftl" type="freemarker" />
> </definition>
Yes.
> In the freemarker template /ftl/administrator/layout.ftl defined in the
> definition above is this line necessary?
>
> <#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
If you are using Tiles 2.2.x, you can use native Freemarker support:
http://tiles.apache.org/framework/tutorial/integration/freemarker.html
Antonio
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by Antonio Petrelli <an...@gmail.com>.
2010/7/30 heamaya <he...@gmail.com>:
>
>
> Antonio Petrelli-3 wrote:
>>
>> If you are using Tiles 2.2.x, you can use native Freemarker support:
>> http://tiles.apache.org/framework/tutorial/integration/freemarker.html
>>
>
> I'm using native freemarker support. In this case this line in the
> freemarker layout.ftl template isn't necessary? <#assign
> tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
Sorry I forgot to say it :-D you can remove it safely.
> Antonio Petrelli-3 wrote:
>>
>> I don't recommend JSP anyway, choose what you prefer.
>>
> Why? What makes freemarker better?
I did not mean this, I mean "I don't recommend anything, choose
following your tastes".
Antonio
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by heamaya <he...@gmail.com>.
Antonio Petrelli-3 wrote:
>
> If you are using Tiles 2.2.x, you can use native Freemarker support:
> http://tiles.apache.org/framework/tutorial/integration/freemarker.html
>
I'm using native freemarker support. In this case this line in the
freemarker layout.ftl template isn't necessary? <#assign
tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
Antonio Petrelli-3 wrote:
>
> The TilesInitializerServlet does not need a servlet mapping. The
> Freemarker servlet needs to be mappend, for example, to *.ftl URLs.
>
I have removed the TilesInitializerServlet mapping and I have changed the
Freemarker to *.ftl
Antonio Petrelli-3 wrote:
>
> Please do not write in all capitals, it is considered rude.
> Anyway
>
I apologize for being rude, I didn't know capital letters were rude.
Antonio Petrelli-3 wrote:
>
> I don't recommend JSP anyway, choose what you prefer.
>
Why? What makes freemarker better?
Antonio Petrelli-3 wrote:
>
> I must confess that the best MVC integration with Tiles is with Spring
> MVC
>
I decided to use Struts 2 MVC because I like the way the view components it
has can be used and extended, in Spring MVC I would have to create
components from the start. Nevertheless, I'm using Spring with transaction
management, dependency injection or IoC and AOP
--
View this message in context: http://old.nabble.com/Struts-2-Tiles-2-Freemarker-Integration-tp29297517p29307089.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by heamaya <he...@gmail.com>.
This is the URL :
http://localhost:8080/RemOpt/administrator/OperatorAction_list.action
This is the struts.xml part concerning to this URL:
<package name="administrator" namespace="/administrator"
extends="tiles-default">
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult"
default="true" />
</result-types>
<default-interceptor-ref name="paramsPrepareParamsStack" />
<default-action-ref name="VendorAction_list" />
<global-results>
<result name="error">
error
</result>
</global-results>
<global-exception-mappings>
<exception-mapping result="error" exception="java.lang.Exception" />
<exception-mapping result="error"
exception="org.apache.tiles.preparer.PreparerException" />
</global-exception-mappings>
<action name="*_list" class="ro.action.{1}" method="list">
<result name="input">
${destination}
</result>
<result name="success">
${destination}
</result>
<result name="list">
${destination}Listing
</result>
</action>
<action name="*_*" class="ro.action.{1}" method="{2}">
<result name="input">
${destination}
</result>
<result name="success">
${destination}
</result>
<result name="list" type="redirectAction">
${destination}_list
/administrator
</result>
<result name="find" type="redirectAction">
${destination}_find
/administrator
</result>
</action>
Maybe this has something to do with the freemarker servlet in this property
<init-param>
<param-name>TemplatePath</param-name>
<param-value>/WEB-INF/ftl</param-value>
</init-param>
Or in TilesFactory in method registerAttributeRenderers in this line
freemarkerRenderer.setParameter("TemplatePath", "/WEB-INF/ftl");
Because I guess this are the places where you say to freemarker were to look
for templates but I'm not sure that's why I'm asking whether I have to load
templates in a different way, for example with a class as the freemarker
documentation says:
http://freemarker.sourceforge.net/docs/pgui_config_templateloading.html
--
View this message in context: http://old.nabble.com/Struts-2-Tiles-2-Freemarker-Integration-tp29297517p29307286.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by Antonio Petrelli <an...@gmail.com>.
2010/7/30 heamaya <he...@gmail.com>:
>
> I keep on getting an HTTP 404 NOT FOUND error
> in the Eclipse Console I get this:
>
> 18:29:50,522 DEBUG cache:81 - Could not find template in cache, creating new
> one; id=[ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] ]
>
> and If I try to access again I get this in the console:
>
> 18:29:55,961 DEBUG cache:81 -
> ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] no source found.
>
> It seems the templates are not loaded, how do I load them? Do I have to
> load the templates I have developed ?
I really have no idea of what is the problem. If you call the URL
directly, can you see it? At least, does it still give a 404?
Antonio
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by heamaya <he...@gmail.com>.
I keep on getting an HTTP 404 NOT FOUND error
in the Eclipse Console I get this:
18:29:50,522 DEBUG cache:81 - Could not find template in cache, creating new
one; id=[ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] ]
and If I try to access again I get this in the console:
18:29:55,961 DEBUG cache:81 -
ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] no source found.
It seems the templates are not loaded, how do I load them? Do I have to
load the templates I have developed ?
--
View this message in context: http://old.nabble.com/Struts-2-Tiles-2-Freemarker-Integration-tp29297517p29307120.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by Antonio Petrelli <an...@gmail.com>.
2010/7/30 heamaya <he...@gmail.com>:
>
> TO SUM UP IS IT POSSIBLE TO INTEGRATE STRUTS 2.1.8, TILES 2.2.2, AND
> FREEMARKER?
> BECAUSE I'M HAVING TROUBLES WITH THIS, DO YOU RECOMMEND ME TO USE JSP
> INSTEAD OF FREEMARKER AS THE VIEW TECHNOLOGY?
Please do not write in all capitals, it is considered rude.
Anyway... I really don't know it. Struts uses a way to initialize
Freemarker that is extremely different to the default, i.e. a servlet,
that is used by Tiles. You've got to try it by yourself, sorry.
I must confess that the best MVC integration with Tiles is with Spring
MVC, Struts people seems not too much interested in Tiles.
I don't recommend JSP anyway, choose what you prefer.
Antonio
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by heamaya <he...@gmail.com>.
TO SUM UP IS IT POSSIBLE TO INTEGRATE STRUTS 2.1.8, TILES 2.2.2, AND
FREEMARKER?
BECAUSE I'M HAVING TROUBLES WITH THIS, DO YOU RECOMMEND ME TO USE JSP
INSTEAD OF FREEMARKER AS THE VIEW TECHNOLOGY?
heamaya wrote:
>
> I'm getting an HTTP 404 NOT FOUND error
>
> and in the Eclipse Console I get this:
>
> 18:29:50,522 DEBUG cache:81 - Could not find template in cache, creating
> new one; id=[ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] ]
>
> and If I try to access again I get this in the console:
>
> 18:29:55,961 DEBUG cache:81 -
> ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] no source found.
>
> It seems the templates are not loaded, how do I load them?
>
>
>
> heamaya wrote:
>>
>> Are this Servlet mappings correct?
>>
>> <servlet-mapping>
>> <servlet-name>freemarker</servlet-name>
>> <url-pattern>/*</url-pattern>
>> </servlet-mapping>
>>
>> <servlet-mapping>
>> <servlet-name>roTilesInitializerServlet</servlet-name>
>> <url-pattern>/*</url-pattern>
>> </servlet-mapping>
>>
>>
>> heamaya wrote:
>>>
>>> Thank you, the exception has disappeared! Problem solved. Now I get a
>>> message:
>>> HTTP Status 405 - HTTP method GET is not supported by this URL... But it
>>> seems this is a struts 2 problem and not a tiles 2 problem, is this
>>> correct?
>>>
>>> I would like to evacuate some doubts:
>>>
>>> When I write a definition in the xml file can it be a freemarker
>>> template?
>>>
>>> <definition name="administratorBase"
>>> template="/ftl/administrator/layout.ftl" >
>>> <put-attribute name="header" value="/ftl/header.ftl" type="freemarker"
>>> />
>>> <put-attribute name="menu" value="/ftl/administrator/menu.ftl"
>>> type="freemarker" />
>>> <put-attribute name="footer" value="/ftl/footer.ftl" type="freemarker"
>>> />
>>> </definition>
>>>
>>> In the freemarker template /ftl/administrator/layout.ftl defined in the
>>> definition above is this line necessary?
>>>
>>> <#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
>>>
>>>
>>>
>>> Antonio Petrelli-3 wrote:
>>>>
>>>> 2010/7/28 Hernán <he...@gmail.com>:
>>>>> @Override
>>>>> protected void registerAttributeRenderers(
>>>>> BasicRendererFactory rendererFactory,
>>>>> TilesApplicationContext applicationContext,
>>>>> TilesRequestContextFactory contextFactory,
>>>>> TilesContainer container,
>>>>> AttributeEvaluatorFactory attributeEvaluatorFactory)
>>>>> {
>>>>> FreeMarkerAttributeRenderer freemarkerRenderer = new
>>>>> FreeMarkerAttributeRenderer();
>>>>>...
>>>>
>>>> You miss the call to super.registerAttributeRenderers.
>>>>
>>>> Antonio
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://old.nabble.com/Struts-2-Tiles-2-Freemarker-Integration-tp29297517p29301267.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by heamaya <he...@gmail.com>.
I'm getting an HTTP 404 NOT FOUND error
and in the Eclipse Console I get this:
18:29:50,522 DEBUG cache:81 - Could not find template in cache, creating new
one; id=[ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] ]
and If I try to access again I get this in the console:
18:29:55,961 DEBUG cache:81 -
ftl/administrator/layout.ftl[en_US,ISO-8859-1,parsed] no source found.
It seems the templates are not loaded, how do I load them?
heamaya wrote:
>
> Are this Servlet mappings correct?
>
> <servlet-mapping>
> <servlet-name>freemarker</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
> <servlet-name>roTilesInitializerServlet</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
>
> heamaya wrote:
>>
>> Thank you, the exception has disappeared! Problem solved. Now I get a
>> message:
>> HTTP Status 405 - HTTP method GET is not supported by this URL... But it
>> seems this is a struts 2 problem and not a tiles 2 problem, is this
>> correct?
>>
>> I would like to evacuate some doubts:
>>
>> When I write a definition in the xml file can it be a freemarker
>> template?
>>
>> <definition name="administratorBase"
>> template="/ftl/administrator/layout.ftl" >
>> <put-attribute name="header" value="/ftl/header.ftl" type="freemarker"
>> />
>> <put-attribute name="menu" value="/ftl/administrator/menu.ftl"
>> type="freemarker" />
>> <put-attribute name="footer" value="/ftl/footer.ftl" type="freemarker"
>> />
>> </definition>
>>
>> In the freemarker template /ftl/administrator/layout.ftl defined in the
>> definition above is this line necessary?
>>
>> <#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
>>
>>
>>
>> Antonio Petrelli-3 wrote:
>>>
>>> 2010/7/28 Hernán <he...@gmail.com>:
>>>> @Override
>>>> protected void registerAttributeRenderers(
>>>> BasicRendererFactory rendererFactory,
>>>> TilesApplicationContext applicationContext,
>>>> TilesRequestContextFactory contextFactory,
>>>> TilesContainer container,
>>>> AttributeEvaluatorFactory attributeEvaluatorFactory)
>>>> {
>>>> FreeMarkerAttributeRenderer freemarkerRenderer = new
>>>> FreeMarkerAttributeRenderer();
>>>>...
>>>
>>> You miss the call to super.registerAttributeRenderers.
>>>
>>> Antonio
>>>
>>>
>>
>>
>
>
--
View this message in context: http://old.nabble.com/Struts-2-Tiles-2-Freemarker-Integration-tp29297517p29300845.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by Antonio Petrelli <an...@gmail.com>.
2010/7/29 heamaya <he...@gmail.com>:
>
> Are this Servlet mappings correct?
>
> <servlet-mapping>
> <servlet-name>freemarker</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
> <servlet-name>roTilesInitializerServlet</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
The TilesInitializerServlet does not need a servlet mapping. The
Freemarker servlet needs to be mappend, for example, to *.ftl URLs.
Antonio
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by heamaya <he...@gmail.com>.
Are this Servlet mappings correct?
<servlet-mapping>
<servlet-name>freemarker</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>roTilesInitializerServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
heamaya wrote:
>
> Thank you, the exception has disappeared! Problem solved. Now I get a
> message:
> HTTP Status 405 - HTTP method GET is not supported by this URL... But it
> seems this is a struts 2 problem and not a tiles 2 problem, is this
> correct?
>
> I would like to evacuate some doubts:
>
> When I write a definition in the xml file can it be a freemarker template?
>
> <definition name="administratorBase"
> template="/ftl/administrator/layout.ftl" >
> <put-attribute name="header" value="/ftl/header.ftl" type="freemarker"
> />
> <put-attribute name="menu" value="/ftl/administrator/menu.ftl"
> type="freemarker" />
> <put-attribute name="footer" value="/ftl/footer.ftl" type="freemarker"
> />
> </definition>
>
> In the freemarker template /ftl/administrator/layout.ftl defined in the
> definition above is this line necessary?
>
> <#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
>
>
>
> Antonio Petrelli-3 wrote:
>>
>> 2010/7/28 Hernán <he...@gmail.com>:
>>> @Override
>>> protected void registerAttributeRenderers(
>>> BasicRendererFactory rendererFactory,
>>> TilesApplicationContext applicationContext,
>>> TilesRequestContextFactory contextFactory,
>>> TilesContainer container,
>>> AttributeEvaluatorFactory attributeEvaluatorFactory)
>>> {
>>> FreeMarkerAttributeRenderer freemarkerRenderer = new
>>> FreeMarkerAttributeRenderer();
>>>...
>>
>> You miss the call to super.registerAttributeRenderers.
>>
>> Antonio
>>
>>
>
>
--
View this message in context: http://old.nabble.com/Struts-2-Tiles-2-Freemarker-Integration-tp29297517p29300617.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by heamaya <he...@gmail.com>.
Thank you, the exception has disappeared! Problem solved. Now I get a
message:
HTTP Status 405 - HTTP method GET is not supported by this URL... But it
seems this is a struts 2 problem and not a tiles 2 problem, is this correct?
I would like to evacuate some doubts:
When I write a definition in the xml file can it be a freemarker template?
<definition name="administratorBase"
template="/ftl/administrator/layout.ftl" >
<put-attribute name="header" value="/ftl/header.ftl" type="freemarker" />
<put-attribute name="menu" value="/ftl/administrator/menu.ftl"
type="freemarker" />
<put-attribute name="footer" value="/ftl/footer.ftl" type="freemarker" />
</definition>
In the freemarker template /ftl/administrator/layout.ftl defined in the
definition above is this line necessary?
<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
Antonio Petrelli-3 wrote:
>
> 2010/7/28 Hernán <he...@gmail.com>:
>> @Override
>> protected void registerAttributeRenderers(
>> BasicRendererFactory rendererFactory,
>> TilesApplicationContext applicationContext,
>> TilesRequestContextFactory contextFactory,
>> TilesContainer container,
>> AttributeEvaluatorFactory attributeEvaluatorFactory)
>> {
>> FreeMarkerAttributeRenderer freemarkerRenderer = new
>> FreeMarkerAttributeRenderer();
>>...
>
> You miss the call to super.registerAttributeRenderers.
>
> Antonio
>
>
--
View this message in context: http://old.nabble.com/Struts-2-Tiles-2-Freemarker-Integration-tp29297517p29300296.html
Sent from the tiles users mailing list archive at Nabble.com.
Re: Struts 2 Tiles 2 Freemarker Integration
Posted by Antonio Petrelli <an...@gmail.com>.
2010/7/28 Hernán <he...@gmail.com>:
> @Override
> protected void registerAttributeRenderers(
> BasicRendererFactory rendererFactory,
> TilesApplicationContext applicationContext,
> TilesRequestContextFactory contextFactory,
> TilesContainer container,
> AttributeEvaluatorFactory attributeEvaluatorFactory)
> {
> FreeMarkerAttributeRenderer freemarkerRenderer = new
> FreeMarkerAttributeRenderer();
>...
You miss the call to super.registerAttributeRenderers.
Antonio