You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Mads Henderson <ma...@gmail.com> on 2007/03/10 15:52:24 UTC
JSF 1.2 and Shale Tiles problem
Hi!
I am trying to get Shale Tiles to work with JSF 1.2_04 (RI), and I have some
problems concerning injecting a tile into my template.
I have tried to make a small example application using the JBoss hellojsf
example, in order to have a working demo before upgrading my production
site.
I have the following:
template.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<html>
<head><title>Simple jsp page</title></head>
<body>
<f:view>
This is a simple test
<f:subview id="content">
<tiles:attribute name="body" flush="false"/>
</f:subview>
</f:view>
</body>
</html>
What I want to do is to inject the content of my index.jsp page in the place
of the body attribute.
I have defined the following in the tiles-definitions.ml:
<?xml version="1.0"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://struts.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="/layout" template="/template.jsp">
<put name="body" value="" />
</definition>
<definition name="/index" extends="/layout" >
<put name="body" value="/index.jsp" />
</definition>
</tiles-definitions>
in my web.xml I have added the tiles listener:
<listener>
<listener-class>org.apache.tiles.listener.TilesListener</listener-class>
</listener>
and also mapped the jsf extension to the faces servlet:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
When I hit the index.jsf URL of the deployed application all I get is the
content of the template.jsp except for the parts inside the <f:view> tag.
So it seems that tiles is correctly loading the template, but I some how
failed to make the correct configuration of how to insert the parts coming
from index.jsp. Can any one see what I am doing wrong?
I'm using the files from Shale Framework 1.0.4 (shale-tiles.jar and
tiles-core.jar).
Best regards,
Mads
Re: JSF 1.2 and Shale Tiles problem
Posted by Greg Reddin <gr...@gmail.com>.
On 3/13/07, Mads Henderson <ma...@gmail.com> wrote:
>
> Are there anybody that have a working view handler for the current jsf
> 1.2and tiles core?
I have not tried to use Tiles with JSF 1.2 as of yet. Sorry for the lack of
information so far. :-)
Greg
Re: JSF 1.2 and Shale Tiles problem
Posted by Mads Henderson <ma...@gmail.com>.
I have found the following:
http://issues.apache.org/struts/browse/SHALE-302
http://forum.java.sun.com/thread.jspa?threadID=770686&messageID=4408064
It seems that a bug was reported against the TilesViewHandler in October
2006.
Are there anybody that have a working view handler for the current jsf
1.2and tiles core?
Thanks
Mads
On 3/12/07, Mads Henderson <ma...@gmail.com> wrote:
>
> The one I am using was downloaded march 10'th with the
> shale-framework-1.0.4.zip file. So it is pretty new.
>
> Thanks
> Mads
>
> On 3/10/07, Hermod Opstvedt <he...@opstvedt.com> wrote:
> >
> > Hi
> >
> > Which version of Tiles are you using? I know that there are issues with
> > a
> > lot the Tiles releases.
> >
> > Hermod
> >
> > -----Opprinnelig melding-----
> > Fra: Mads Henderson [mailto: mads.henderson@gmail.com]
> > Sendt: 10. mars 2007 15:52
> > Til: user@shale.apache.org
> > Emne: JSF 1.2 and Shale Tiles problem
> >
> > Hi!
> >
> > I am trying to get Shale Tiles to work with JSF 1.2_04 (RI), and I have
> > some
> > problems concerning injecting a tile into my template.
> >
> > I have tried to make a small example application using the JBoss
> > hellojsf
> > example, in order to have a working demo before upgrading my production
> > site.
> >
> > I have the following:
> > template.jsp:
> > <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> > <%@ taglib prefix="f" uri=" http://java.sun.com/jsf/core" %>
> > <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
> > <html>
> > <head><title>Simple jsp page</title></head>
> > <body>
> > <f:view>
> > This is a simple test
> > <f:subview id="content">
> > <tiles:attribute name="body" flush="false"/>
> > </f:subview>
> > </f:view>
> > </body>
> > </html>
> >
> > What I want to do is to inject the content of my index.jsp page in the
> > place
> > of the body attribute.
> > I have defined the following in the tiles-definitions.ml:
> > <?xml version="1.0"?>
> >
> > <!DOCTYPE tiles-definitions PUBLIC
> > "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
> > " http://struts.apache.org/dtds/tiles-config_2_0.dtd">
> >
> > <tiles-definitions>
> > <definition name="/layout" template="/template.jsp">
> > <put name="body" value="" />
> > </definition>
> >
> > <definition name="/index" extends="/layout" >
> > <put name="body" value="/index.jsp" />
> > </definition>
> >
> > </tiles-definitions>
> >
> > in my web.xml I have added the tiles listener:
> > <listener>
> > <listener-class>org.apache.tiles.listener.TilesListener
> > </listener-class>
> > </listener>
> >
> > and also mapped the jsf extension to the faces servlet:
> > <servlet-mapping>
> > <servlet-name>Faces Servlet</servlet-name>
> > <url-pattern>*.jsf</url-pattern>
> > </servlet-mapping>
> >
> >
> > When I hit the index.jsf URL of the deployed application all I get is
> > the
> > content of the template.jsp except for the parts inside the <f:view>
> > tag.
> >
> > So it seems that tiles is correctly loading the template, but I some how
> > failed to make the correct configuration of how to insert the parts
> > coming
> > from index.jsp. Can any one see what I am doing wrong?
> >
> > I'm using the files from Shale Framework 1.0.4 (shale-tiles.jar and
> > tiles-core.jar).
> >
> > Best regards,
> > Mads
> >
> >
>
Re: JSF 1.2 and Shale Tiles problem
Posted by Mads Henderson <ma...@gmail.com>.
The one I am using was downloaded march 10'th with the
shale-framework-1.0.4.zip file. So it is pretty new.
Thanks
Mads
On 3/10/07, Hermod Opstvedt <he...@opstvedt.com> wrote:
>
> Hi
>
> Which version of Tiles are you using? I know that there are issues with a
> lot the Tiles releases.
>
> Hermod
>
> -----Opprinnelig melding-----
> Fra: Mads Henderson [mailto:mads.henderson@gmail.com]
> Sendt: 10. mars 2007 15:52
> Til: user@shale.apache.org
> Emne: JSF 1.2 and Shale Tiles problem
>
> Hi!
>
> I am trying to get Shale Tiles to work with JSF 1.2_04 (RI), and I have
> some
> problems concerning injecting a tile into my template.
>
> I have tried to make a small example application using the JBoss hellojsf
> example, in order to have a working demo before upgrading my production
> site.
>
> I have the following:
> template.jsp:
> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
> <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
> <html>
> <head><title>Simple jsp page</title></head>
> <body>
> <f:view>
> This is a simple test
> <f:subview id="content">
> <tiles:attribute name="body" flush="false"/>
> </f:subview>
> </f:view>
> </body>
> </html>
>
> What I want to do is to inject the content of my index.jsp page in the
> place
> of the body attribute.
> I have defined the following in the tiles-definitions.ml:
> <?xml version="1.0"?>
>
> <!DOCTYPE tiles-definitions PUBLIC
> "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
> "http://struts.apache.org/dtds/tiles-config_2_0.dtd">
>
> <tiles-definitions>
> <definition name="/layout" template="/template.jsp">
> <put name="body" value="" />
> </definition>
>
> <definition name="/index" extends="/layout" >
> <put name="body" value="/index.jsp" />
> </definition>
>
> </tiles-definitions>
>
> in my web.xml I have added the tiles listener:
> <listener>
> <listener-class>org.apache.tiles.listener.TilesListener
> </listener-class>
> </listener>
>
> and also mapped the jsf extension to the faces servlet:
> <servlet-mapping>
> <servlet-name>Faces Servlet</servlet-name>
> <url-pattern>*.jsf</url-pattern>
> </servlet-mapping>
>
>
> When I hit the index.jsf URL of the deployed application all I get is the
> content of the template.jsp except for the parts inside the <f:view> tag.
>
> So it seems that tiles is correctly loading the template, but I some how
> failed to make the correct configuration of how to insert the parts coming
> from index.jsp. Can any one see what I am doing wrong?
>
> I'm using the files from Shale Framework 1.0.4 (shale-tiles.jar and
> tiles-core.jar).
>
> Best regards,
> Mads
>
>
SV: JSF 1.2 and Shale Tiles problem
Posted by Hermod Opstvedt <he...@opstvedt.com>.
Hi
Which version of Tiles are you using? I know that there are issues with a
lot the Tiles releases.
Hermod
-----Opprinnelig melding-----
Fra: Mads Henderson [mailto:mads.henderson@gmail.com]
Sendt: 10. mars 2007 15:52
Til: user@shale.apache.org
Emne: JSF 1.2 and Shale Tiles problem
Hi!
I am trying to get Shale Tiles to work with JSF 1.2_04 (RI), and I have some
problems concerning injecting a tile into my template.
I have tried to make a small example application using the JBoss hellojsf
example, in order to have a working demo before upgrading my production
site.
I have the following:
template.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<html>
<head><title>Simple jsp page</title></head>
<body>
<f:view>
This is a simple test
<f:subview id="content">
<tiles:attribute name="body" flush="false"/>
</f:subview>
</f:view>
</body>
</html>
What I want to do is to inject the content of my index.jsp page in the place
of the body attribute.
I have defined the following in the tiles-definitions.ml:
<?xml version="1.0"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://struts.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="/layout" template="/template.jsp">
<put name="body" value="" />
</definition>
<definition name="/index" extends="/layout" >
<put name="body" value="/index.jsp" />
</definition>
</tiles-definitions>
in my web.xml I have added the tiles listener:
<listener>
<listener-class>org.apache.tiles.listener.TilesListener</listener-class>
</listener>
and also mapped the jsf extension to the faces servlet:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
When I hit the index.jsf URL of the deployed application all I get is the
content of the template.jsp except for the parts inside the <f:view> tag.
So it seems that tiles is correctly loading the template, but I some how
failed to make the correct configuration of how to insert the parts coming
from index.jsp. Can any one see what I am doing wrong?
I'm using the files from Shale Framework 1.0.4 (shale-tiles.jar and
tiles-core.jar).
Best regards,
Mads