You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Edward Dowgiallo <ed...@gmail.com> on 2007/08/28 21:31:10 UTC

Fwd: Tiles integration

---------- Forwarded message ----------
From: Edward Dowgiallo <ed...@gmail.com>
Date: Aug 28, 2007 3:20 PM
Subject: Tiles integration
To: users@shale.apache.org

I'm trying to get the following combination running:

   - MyFaces 1.2.0
   - Shale Tiles 1.0.4
   - Trinidad 1.2.1

Willing to try other combinations, especially if someone has a
blank.warhandy.  Been at this for about 7 hours now.

Getting the following exception:

java.lang.IllegalStateException: Cannot create a session after the
response has been committed
	org.apache.catalina.connector.Request.doGetSession(Request.java:2301)

	org.apache.catalina.connector.Request.getSession(Request.java:2075)
	org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
	org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession
(ServletExternalContextImpl.java:117)
	org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession(ExternalContextDecorator.java:92)
	org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession
(ExternalContextDecorator.java:92)
	org.apache.myfaces.trinidadinternal.util.TokenCache.getTokenCacheFromSession(TokenCache.java:72)
	org.apache.myfaces.trinidadinternal.application.StateManagerImpl._getViewCache(StateManagerImpl.java
:548)
	org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:265)
	javax.faces.application.StateManager.saveView(StateManager.java:47)
	org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter.flushToWriter
(JspViewHandlerImpl.java:387)
	org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:322)
	javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45)
	org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
(ViewHandlerImpl.java:174)
	org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
	javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45)
	org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
(ViewHandlerImpl.java:174)
	org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
	org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
	org.apache.myfaces.lifecycle.LifecycleImpl.render
(LifecycleImpl.java:132)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)

tiles-defs.xml

<tiles-definitions>

	<!-- =================================================================== -->

	<!-- Master definition                                                   -->
	<!-- =================================================================== -->

	<!-- Doc index page description  -->

	<definition	name="test"	template="/page/layout.jsp">
		<put-attribute	name="header"	value="/tile/header.jsp"/>
		<put-attribute	name="footer"	value="/tile/footer.jsp"/>

	</definition>

</tiles-definitions>

faces-config.xml

<faces-config
		xmlns="http://java.sun.com/xml/ns/javaee
"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
		version="1.2">

	<application>
		<!-- Tiles Integration -->

		<view-handler>org.apache.shale.tiles.TilesViewHandler</view-handler>
	</application>

</faces-config>

web.xml

<web-app	xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
			xmlns="http://java.sun.com/xml/ns/javaee"
			xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
			xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
			id="WebApp_ID"
			version="2.5">
	<display-name>tiles</display-name>


	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>
default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>

    <context-param>
        <param-name>
javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
        <description>
            State saving method: "client" or "server" (= default)

            See JSF Specification 2.5.2
        </description>
    </context-param>

	<!-- Tiles -->
	<context-param>
		<param-name>definitions-config</param-name>

		<param-value>/WEB-INF/tiles-defs.xml</param-value>
	</context-param>

    <!--context-param>
        <param-name>org.apache.tiles.CONTEXT_FACTORY</param-name>
        <param-value>
org.apache.tiles.context.enhanced.EnhancedContextFactory</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.tiles.CONTAINER_FACTORY.mutable</param-name>

        <param-value>true</param-value>
    </context-param-->

	<listener>
		<listener-class>org.apache.tiles.listener.TilesListener</listener-class>
	</listener>


	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>

	</servlet>

	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.tiles</url-pattern>
	</servlet-mapping>

</web-app>

layout.jsp

<html>
	<head><title>Tiles Quickstart</title><head>
	<body>
		<tiles:insertAttribute	name="header"/>

		<div id="body">
			Tiles 101 body content.
		</div>

		<tiles:insertAttribute	name="footer"/>
	</body>
</html>

Re: SV: Tiles integration

Posted by Gregg Leichtman <gs...@erols.com>.
I have attached the TilesViewHandler source to the existing bug report at:

    https://issues.apache.org/struts/browse/SHALE-302

I granted ASF Works inclusion, but Sun com package code is involved, so
you may have to sort the licensing issues out depending on what you do
with it.

For those developers who are using the Shale API versus developing it,
if you wish to use this code to work with Tiles, JSF 1.2 RI and Shale,
feel free to do so, but note that it is completely experimental
non-production level code and you use it at your own risk.

                         -=> Gregg <=-

Greg Reddin wrote:
> On 10/4/07, Gregg Leichtman <gs...@erols.com> wrote:
>   
>> If there is interest I would be happy to post it as a JIRA item.
>>     
>
>
> Please do :-)
>
> Greg
>
>   


Re: SV: Tiles integration

Posted by Greg Reddin <gr...@gmail.com>.
On 10/4/07, Gregg Leichtman <gs...@erols.com> wrote:
>
> If there is interest I would be happy to post it as a JIRA item.


Please do :-)

Greg

Re: SV: Tiles integration

Posted by Gregg Leichtman <gs...@erols.com>.
Sorry I didn't reply to this earlier, but I didn't see it until now.

I did not do this, because the code is RI specific. It uses a number of
Sun com classes in the imports for example. When I posted this
previously on 7/25 under topic: "Any sucess with shale nightly 20070717
and RI JSF 1.2?", Mr VanMatre correctly pointed this out and I just
thought that this meant that the Shale developers would rather just go
their own way rather than use anything from this code.

I have been using this view handler since that time and have not had
problems with it. I'm using Tiles 2.0.4, Trinidad 1.2.1, Tomahawk 1.1.6,
dojo 0.9, shale 1.1.0 snapshot 20070923. Haven't used much of Shale yet,
just really Tiles so far and haven't mixed in Spring or Hibernate, since
I have not gotten to that part in my dev effort so I can speak to them yet.

If there is interest I would be happy to post it as a JIRA item.

                                    -=> Gregg <=-

Antonio Petrelli wrote:
> Gregg, why don't you post your work as a patch in JIRA?
> If you cannot find the right issue, open a new one. Anyway good candidates
> are:
> https://issues.apache.org/struts/browse/SHALE/component/21281
>
> Antonio
>
> 2007/9/13, Gregg Leichtman <gs...@erols.com>:
>   
>> I was not successful in getting the webapp stack that you mention to
>> work. I ended up modifying an old TilesViewHandler to work with JSF 1.2
>> RI v1.2_04-b16-p02, not MyFaces, a nightly snapshot of Shale 1.1.0 from
>> July 17, 2007, the released version of Trinidad 1.2.1, Tomahawk 1.1.6,
>> JSTL 1.1.2 and Tiles 2.0.4. The view handler has worked well for me so
>> far, (I'm still just developing my webapp with it) so if you're willing
>> to use this experimental version along with the RI until these issues
>> are resolved, you can find a posted copy of the source code at:
>>
>>
>>
>> http://www.nabble.com/Any-sucess-with-shale-nightly-20070717-and-RI-JSF-1.2--tf4123632.html#a11784014
>>
>>                   -=> Gregg <=-
>>
>> Hermod Opstvedt wrote:
>>     
>>> Hi
>>>
>>> I don't think think MyFaces 1.2 is compatible with that Tiles version -
>>>       
>> Ask
>>     
>>> on the MyFaces list.
>>>
>>> Hermod
>>>
>>> -----Opprinnelig melding-----
>>> Fra: Edward Dowgiallo [mailto:eddowgiallo@gmail.com]
>>> Sendt: 28. august 2007 21:31
>>> Til: user@shale.apache.org
>>> Emne: Fwd: Tiles integration
>>>
>>> ---------- Forwarded message ----------
>>> From: Edward Dowgiallo <ed...@gmail.com>
>>> Date: Aug 28, 2007 3:20 PM
>>> Subject: Tiles integration
>>> To: users@shale.apache.org
>>>
>>> I'm trying to get the following combination running:
>>>
>>>    - MyFaces 1.2.0
>>>    - Shale Tiles 1.0.4
>>>    - Trinidad 1.2.1
>>>
>>> Willing to try other combinations, especially if someone has a
>>> blank.warhandy.  Been at this for about 7 hours now.
>>>
>>> Getting the following exception:
>>>
>>> java.lang.IllegalStateException: Cannot create a session after the
>>>       
>> response
>>     
>>> has been committed
>>>
>>> org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
>>>
>>>       org.apache.catalina.connector.Request.getSession(Request.java
>>>       
>> :2075)
>>     
>>> org.apache.catalina.connector.RequestFacade.getSession(
>>>       
>> RequestFacade.java:83
>>     
>>> 3)
>>>
>>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession
>>> (ServletExternalContextImpl.java:117)
>>>
>>> org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession
>>>       
>> (Exte
>>     
>>> rnalContextDecorator.java:92)
>>>
>>> org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession
>>> (ExternalContextDecorator.java:92)
>>>
>>>
>>>       
>> org.apache.myfaces.trinidadinternal.util.TokenCache.getTokenCacheFromSession
>>     
>>> (TokenCache.java:72)
>>>
>>>
>>>       
>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl._getViewCac
>>     
>>> he(StateManagerImpl.java
>>> :548)
>>>
>>>
>>>       
>> org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveSeriali
>>     
>>> zedView(StateManagerImpl.java:265)
>>>       javax.faces.application.StateManager.saveView(StateManager.java
>>>       
>> :47)
>>     
>>>       
>> org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter
>>     
>>> .flushToWriter
>>> (JspViewHandlerImpl.java:387)
>>>
>>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
>>>       
>> (JspViewHand
>>     
>>> lerImpl.java:322)
>>>
>>> javax.faces.application.ViewHandlerWrapper.renderView(
>>>       
>> ViewHandlerWrapper.jav
>>     
>>> a:45)
>>>
>>>
>>>       
>> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
>>     
>>> (ViewHandlerImpl.java:174)
>>>
>>> org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java
>>>       
>> :176
>>     
>>> )
>>>
>>> javax.faces.application.ViewHandlerWrapper.renderView(
>>>       
>> ViewHandlerWrapper.jav
>>     
>>> a:45)
>>>
>>>
>>>       
>> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
>>     
>>> (ViewHandlerImpl.java:174)
>>>
>>> org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java
>>>       
>> :176
>>     
>>> )
>>>
>>> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
>>>       
>> (RenderResponseEx
>>     
>>> ecutor.java:41)
>>>       org.apache.myfaces.lifecycle.LifecycleImpl.render
>>> (LifecycleImpl.java:132)
>>>       javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>>>
>>> tiles-defs.xml
>>>
>>> <tiles-definitions>
>>>
>>>       <!--
>>> =================================================================== -->
>>>
>>>       <!-- Master definition
>>> -->
>>>       <!--
>>> =================================================================== -->
>>>
>>>       <!-- Doc index page description  -->
>>>
>>>       <definition     name="test"     template="/page/layout.jsp">
>>>               <put-attribute  name="header"   value="/tile/header.jsp"/>
>>>               <put-attribute  name="footer"   value="/tile/footer.jsp"/>
>>>
>>>       </definition>
>>>
>>> </tiles-definitions>
>>>
>>> faces-config.xml
>>>
>>> <faces-config
>>>               xmlns="http://java.sun.com/xml/ns/javaee
>>> "
>>>               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>>>  http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
>>>               version="1.2">
>>>
>>>       <application>
>>>               <!-- Tiles Integration -->
>>>
>>>
>>> <view-handler>org.apache.shale.tiles.TilesViewHandler</view-handler>
>>>       </application>
>>>
>>> </faces-config>
>>>
>>> web.xml
>>>
>>> <web-app      xmlns:xsi="
>>> http://www.w3.org/2001/XMLSchema-instance"
>>>                       xmlns="http://java.sun.com/xml/ns/javaee"
>>>                       xmlns:web="
>>> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>>>
>>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>>>  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>>>                       id="WebApp_ID"
>>>                       version="2.5">
>>>       <display-name>tiles</display-name>
>>>
>>>
>>>       <welcome-file-list>
>>>               <welcome-file>index.html</welcome-file>
>>>               <welcome-file>index.htm</welcome-file>
>>>               <welcome-file>index.jsp</welcome-file>
>>>               <welcome-file>
>>> default.html</welcome-file>
>>>               <welcome-file>default.htm</welcome-file>
>>>               <welcome-file>default.jsp</welcome-file>
>>>       </welcome-file-list>
>>>
>>>     <context-param>
>>>         <param-name>
>>> javax.faces.STATE_SAVING_METHOD</param-name>
>>>         <param-value>client</param-value>
>>>         <description>
>>>             State saving method: "client" or "server" (= default)
>>>
>>>             See JSF Specification 2.5.2
>>>         </description>
>>>     </context-param>
>>>
>>>       <!-- Tiles -->
>>>       <context-param>
>>>               <param-name>definitions-config</param-name>
>>>
>>>               <param-value>/WEB-INF/tiles-defs.xml</param-value>
>>>       </context-param>
>>>
>>>     <!--context-param>
>>>         <param-name>org.apache.tiles.CONTEXT_FACTORY</param-name>
>>>         <param-value>
>>> org.apache.tiles.context.enhanced.EnhancedContextFactory</param-value>
>>>     </context-param>
>>>
>>>     <context-param>
>>>         <param-name>org.apache.tiles.CONTAINER_FACTORY.mutable
>>>       
>> </param-name>
>>     
>>>         <param-value>true</param-value>
>>>     </context-param-->
>>>
>>>       <listener>
>>>
>>> <listener-class>org.apache.tiles.listener.TilesListener</listener-class>
>>>       </listener>
>>>
>>>
>>>       <servlet>
>>>               <servlet-name>Faces Servlet</servlet-name>
>>>
>>> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>>>               <load-on-startup>1</load-on-startup>
>>>
>>>       </servlet>
>>>
>>>       <servlet-mapping>
>>>               <servlet-name>Faces Servlet</servlet-name>
>>>               <url-pattern>*.tiles</url-pattern>
>>>       </servlet-mapping>
>>>
>>> </web-app>
>>>
>>> layout.jsp
>>>
>>> <html>
>>>       <head><title>Tiles Quickstart</title><head>
>>>       <body>
>>>               <tiles:insertAttribute  name="header"/>
>>>
>>>               <div id="body">
>>>                       Tiles 101 body content.
>>>               </div>
>>>
>>>               <tiles:insertAttribute  name="footer"/>
>>>       </body>
>>> </html>
>>>
>>>
>>>       
>>     
>
>   


Re: SV: Tiles integration

Posted by Antonio Petrelli <an...@gmail.com>.
Gregg, why don't you post your work as a patch in JIRA?
If you cannot find the right issue, open a new one. Anyway good candidates
are:
https://issues.apache.org/struts/browse/SHALE/component/21281

Antonio

2007/9/13, Gregg Leichtman <gs...@erols.com>:
>
> I was not successful in getting the webapp stack that you mention to
> work. I ended up modifying an old TilesViewHandler to work with JSF 1.2
> RI v1.2_04-b16-p02, not MyFaces, a nightly snapshot of Shale 1.1.0 from
> July 17, 2007, the released version of Trinidad 1.2.1, Tomahawk 1.1.6,
> JSTL 1.1.2 and Tiles 2.0.4. The view handler has worked well for me so
> far, (I'm still just developing my webapp with it) so if you're willing
> to use this experimental version along with the RI until these issues
> are resolved, you can find a posted copy of the source code at:
>
>
>
> http://www.nabble.com/Any-sucess-with-shale-nightly-20070717-and-RI-JSF-1.2--tf4123632.html#a11784014
>
>                   -=> Gregg <=-
>
> Hermod Opstvedt wrote:
> > Hi
> >
> > I don't think think MyFaces 1.2 is compatible with that Tiles version -
> Ask
> > on the MyFaces list.
> >
> > Hermod
> >
> > -----Opprinnelig melding-----
> > Fra: Edward Dowgiallo [mailto:eddowgiallo@gmail.com]
> > Sendt: 28. august 2007 21:31
> > Til: user@shale.apache.org
> > Emne: Fwd: Tiles integration
> >
> > ---------- Forwarded message ----------
> > From: Edward Dowgiallo <ed...@gmail.com>
> > Date: Aug 28, 2007 3:20 PM
> > Subject: Tiles integration
> > To: users@shale.apache.org
> >
> > I'm trying to get the following combination running:
> >
> >    - MyFaces 1.2.0
> >    - Shale Tiles 1.0.4
> >    - Trinidad 1.2.1
> >
> > Willing to try other combinations, especially if someone has a
> > blank.warhandy.  Been at this for about 7 hours now.
> >
> > Getting the following exception:
> >
> > java.lang.IllegalStateException: Cannot create a session after the
> response
> > has been committed
> >
> > org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
> >
> >       org.apache.catalina.connector.Request.getSession(Request.java
> :2075)
> >
> > org.apache.catalina.connector.RequestFacade.getSession(
> RequestFacade.java:83
> > 3)
> >
> > org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession
> > (ServletExternalContextImpl.java:117)
> >
> > org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession
> (Exte
> > rnalContextDecorator.java:92)
> >
> > org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession
> > (ExternalContextDecorator.java:92)
> >
> >
> org.apache.myfaces.trinidadinternal.util.TokenCache.getTokenCacheFromSession
> > (TokenCache.java:72)
> >
> >
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl._getViewCac
> > he(StateManagerImpl.java
> > :548)
> >
> >
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveSeriali
> > zedView(StateManagerImpl.java:265)
> >       javax.faces.application.StateManager.saveView(StateManager.java
> :47)
> >
> >
> org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter
> > .flushToWriter
> > (JspViewHandlerImpl.java:387)
> >
> > org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
> (JspViewHand
> > lerImpl.java:322)
> >
> > javax.faces.application.ViewHandlerWrapper.renderView(
> ViewHandlerWrapper.jav
> > a:45)
> >
> >
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
> > (ViewHandlerImpl.java:174)
> >
> > org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java
> :176
> > )
> >
> > javax.faces.application.ViewHandlerWrapper.renderView(
> ViewHandlerWrapper.jav
> > a:45)
> >
> >
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
> > (ViewHandlerImpl.java:174)
> >
> > org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java
> :176
> > )
> >
> > org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
> (RenderResponseEx
> > ecutor.java:41)
> >       org.apache.myfaces.lifecycle.LifecycleImpl.render
> > (LifecycleImpl.java:132)
> >       javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> >
> > tiles-defs.xml
> >
> > <tiles-definitions>
> >
> >       <!--
> > =================================================================== -->
> >
> >       <!-- Master definition
> > -->
> >       <!--
> > =================================================================== -->
> >
> >       <!-- Doc index page description  -->
> >
> >       <definition     name="test"     template="/page/layout.jsp">
> >               <put-attribute  name="header"   value="/tile/header.jsp"/>
> >               <put-attribute  name="footer"   value="/tile/footer.jsp"/>
> >
> >       </definition>
> >
> > </tiles-definitions>
> >
> > faces-config.xml
> >
> > <faces-config
> >               xmlns="http://java.sun.com/xml/ns/javaee
> > "
> >               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> >  http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
> >               version="1.2">
> >
> >       <application>
> >               <!-- Tiles Integration -->
> >
> >
> > <view-handler>org.apache.shale.tiles.TilesViewHandler</view-handler>
> >       </application>
> >
> > </faces-config>
> >
> > web.xml
> >
> > <web-app      xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance"
> >                       xmlns="http://java.sun.com/xml/ns/javaee"
> >                       xmlns:web="
> > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> >
> > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> >  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> >                       id="WebApp_ID"
> >                       version="2.5">
> >       <display-name>tiles</display-name>
> >
> >
> >       <welcome-file-list>
> >               <welcome-file>index.html</welcome-file>
> >               <welcome-file>index.htm</welcome-file>
> >               <welcome-file>index.jsp</welcome-file>
> >               <welcome-file>
> > default.html</welcome-file>
> >               <welcome-file>default.htm</welcome-file>
> >               <welcome-file>default.jsp</welcome-file>
> >       </welcome-file-list>
> >
> >     <context-param>
> >         <param-name>
> > javax.faces.STATE_SAVING_METHOD</param-name>
> >         <param-value>client</param-value>
> >         <description>
> >             State saving method: "client" or "server" (= default)
> >
> >             See JSF Specification 2.5.2
> >         </description>
> >     </context-param>
> >
> >       <!-- Tiles -->
> >       <context-param>
> >               <param-name>definitions-config</param-name>
> >
> >               <param-value>/WEB-INF/tiles-defs.xml</param-value>
> >       </context-param>
> >
> >     <!--context-param>
> >         <param-name>org.apache.tiles.CONTEXT_FACTORY</param-name>
> >         <param-value>
> > org.apache.tiles.context.enhanced.EnhancedContextFactory</param-value>
> >     </context-param>
> >
> >     <context-param>
> >         <param-name>org.apache.tiles.CONTAINER_FACTORY.mutable
> </param-name>
> >
> >         <param-value>true</param-value>
> >     </context-param-->
> >
> >       <listener>
> >
> > <listener-class>org.apache.tiles.listener.TilesListener</listener-class>
> >       </listener>
> >
> >
> >       <servlet>
> >               <servlet-name>Faces Servlet</servlet-name>
> >
> > <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
> >               <load-on-startup>1</load-on-startup>
> >
> >       </servlet>
> >
> >       <servlet-mapping>
> >               <servlet-name>Faces Servlet</servlet-name>
> >               <url-pattern>*.tiles</url-pattern>
> >       </servlet-mapping>
> >
> > </web-app>
> >
> > layout.jsp
> >
> > <html>
> >       <head><title>Tiles Quickstart</title><head>
> >       <body>
> >               <tiles:insertAttribute  name="header"/>
> >
> >               <div id="body">
> >                       Tiles 101 body content.
> >               </div>
> >
> >               <tiles:insertAttribute  name="footer"/>
> >       </body>
> > </html>
> >
> >
>
>
>

Re: SV: Tiles integration

Posted by Gregg Leichtman <gs...@erols.com>.
I was not successful in getting the webapp stack that you mention to
work. I ended up modifying an old TilesViewHandler to work with JSF 1.2
RI v1.2_04-b16-p02, not MyFaces, a nightly snapshot of Shale 1.1.0 from
July 17, 2007, the released version of Trinidad 1.2.1, Tomahawk 1.1.6,
JSTL 1.1.2 and Tiles 2.0.4. The view handler has worked well for me so
far, (I'm still just developing my webapp with it) so if you're willing
to use this experimental version along with the RI until these issues
are resolved, you can find a posted copy of the source code at:

   
http://www.nabble.com/Any-sucess-with-shale-nightly-20070717-and-RI-JSF-1.2--tf4123632.html#a11784014

                  -=> Gregg <=-

Hermod Opstvedt wrote:
> Hi
>
> I don't think think MyFaces 1.2 is compatible with that Tiles version - Ask
> on the MyFaces list.
>
> Hermod
>
> -----Opprinnelig melding-----
> Fra: Edward Dowgiallo [mailto:eddowgiallo@gmail.com] 
> Sendt: 28. august 2007 21:31
> Til: user@shale.apache.org
> Emne: Fwd: Tiles integration
>
> ---------- Forwarded message ----------
> From: Edward Dowgiallo <ed...@gmail.com>
> Date: Aug 28, 2007 3:20 PM
> Subject: Tiles integration
> To: users@shale.apache.org
>
> I'm trying to get the following combination running:
>
>    - MyFaces 1.2.0
>    - Shale Tiles 1.0.4
>    - Trinidad 1.2.1
>
> Willing to try other combinations, especially if someone has a
> blank.warhandy.  Been at this for about 7 hours now.
>
> Getting the following exception:
>
> java.lang.IllegalStateException: Cannot create a session after the response
> has been committed
> 	
> org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
>
> 	org.apache.catalina.connector.Request.getSession(Request.java:2075)
> 	
> org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83
> 3)
> 	
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession
> (ServletExternalContextImpl.java:117)
> 	
> org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession(Exte
> rnalContextDecorator.java:92)
> 	
> org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession
> (ExternalContextDecorator.java:92)
> 	
> org.apache.myfaces.trinidadinternal.util.TokenCache.getTokenCacheFromSession
> (TokenCache.java:72)
> 	
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl._getViewCac
> he(StateManagerImpl.java
> :548)
> 	
> org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveSeriali
> zedView(StateManagerImpl.java:265)
> 	javax.faces.application.StateManager.saveView(StateManager.java:47)
> 	
> org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter
> .flushToWriter
> (JspViewHandlerImpl.java:387)
> 	
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHand
> lerImpl.java:322)
> 	
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.jav
> a:45)
> 	
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
> (ViewHandlerImpl.java:174)
> 	
> org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176
> )
> 	
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.jav
> a:45)
> 	
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
> (ViewHandlerImpl.java:174)
> 	
> org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176
> )
> 	
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseEx
> ecutor.java:41)
> 	org.apache.myfaces.lifecycle.LifecycleImpl.render
> (LifecycleImpl.java:132)
> 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
>
> tiles-defs.xml
>
> <tiles-definitions>
>
> 	<!--
> =================================================================== -->
>
> 	<!-- Master definition
> -->
> 	<!--
> =================================================================== -->
>
> 	<!-- Doc index page description  -->
>
> 	<definition	name="test"	template="/page/layout.jsp">
> 		<put-attribute	name="header"	value="/tile/header.jsp"/>
> 		<put-attribute	name="footer"	value="/tile/footer.jsp"/>
>
> 	</definition>
>
> </tiles-definitions>
>
> faces-config.xml
>
> <faces-config
> 		xmlns="http://java.sun.com/xml/ns/javaee
> "
> 		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 		xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>  http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
> 		version="1.2">
>
> 	<application>
> 		<!-- Tiles Integration -->
>
> 	
> <view-handler>org.apache.shale.tiles.TilesViewHandler</view-handler>
> 	</application>
>
> </faces-config>
>
> web.xml
>
> <web-app	xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
> 			xmlns="http://java.sun.com/xml/ns/javaee"
> 			xmlns:web="
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> 	
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> 			id="WebApp_ID"
> 			version="2.5">
> 	<display-name>tiles</display-name>
>
>
> 	<welcome-file-list>
> 		<welcome-file>index.html</welcome-file>
> 		<welcome-file>index.htm</welcome-file>
> 		<welcome-file>index.jsp</welcome-file>
> 		<welcome-file>
> default.html</welcome-file>
> 		<welcome-file>default.htm</welcome-file>
> 		<welcome-file>default.jsp</welcome-file>
> 	</welcome-file-list>
>
>     <context-param>
>         <param-name>
> javax.faces.STATE_SAVING_METHOD</param-name>
>         <param-value>client</param-value>
>         <description>
>             State saving method: "client" or "server" (= default)
>
>             See JSF Specification 2.5.2
>         </description>
>     </context-param>
>
> 	<!-- Tiles -->
> 	<context-param>
> 		<param-name>definitions-config</param-name>
>
> 		<param-value>/WEB-INF/tiles-defs.xml</param-value>
> 	</context-param>
>
>     <!--context-param>
>         <param-name>org.apache.tiles.CONTEXT_FACTORY</param-name>
>         <param-value>
> org.apache.tiles.context.enhanced.EnhancedContextFactory</param-value>
>     </context-param>
>
>     <context-param>
>         <param-name>org.apache.tiles.CONTAINER_FACTORY.mutable</param-name>
>
>         <param-value>true</param-value>
>     </context-param-->
>
> 	<listener>
> 	
> <listener-class>org.apache.tiles.listener.TilesListener</listener-class>
> 	</listener>
>
>
> 	<servlet>
> 		<servlet-name>Faces Servlet</servlet-name>
> 	
> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
> 		<load-on-startup>1</load-on-startup>
>
> 	</servlet>
>
> 	<servlet-mapping>
> 		<servlet-name>Faces Servlet</servlet-name>
> 		<url-pattern>*.tiles</url-pattern>
> 	</servlet-mapping>
>
> </web-app>
>
> layout.jsp
>
> <html>
> 	<head><title>Tiles Quickstart</title><head>
> 	<body>
> 		<tiles:insertAttribute	name="header"/>
>
> 		<div id="body">
> 			Tiles 101 body content.
> 		</div>
>
> 		<tiles:insertAttribute	name="footer"/>
> 	</body>
> </html>
>
>   


SV: Tiles integration

Posted by Hermod Opstvedt <he...@opstvedt.com>.
Hi

I don't think think MyFaces 1.2 is compatible with that Tiles version - Ask
on the MyFaces list.

Hermod

-----Opprinnelig melding-----
Fra: Edward Dowgiallo [mailto:eddowgiallo@gmail.com] 
Sendt: 28. august 2007 21:31
Til: user@shale.apache.org
Emne: Fwd: Tiles integration

---------- Forwarded message ----------
From: Edward Dowgiallo <ed...@gmail.com>
Date: Aug 28, 2007 3:20 PM
Subject: Tiles integration
To: users@shale.apache.org

I'm trying to get the following combination running:

   - MyFaces 1.2.0
   - Shale Tiles 1.0.4
   - Trinidad 1.2.1

Willing to try other combinations, especially if someone has a
blank.warhandy.  Been at this for about 7 hours now.

Getting the following exception:

java.lang.IllegalStateException: Cannot create a session after the response
has been committed
	
org.apache.catalina.connector.Request.doGetSession(Request.java:2301)

	org.apache.catalina.connector.Request.getSession(Request.java:2075)
	
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83
3)
	
org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession
(ServletExternalContextImpl.java:117)
	
org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession(Exte
rnalContextDecorator.java:92)
	
org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession
(ExternalContextDecorator.java:92)
	
org.apache.myfaces.trinidadinternal.util.TokenCache.getTokenCacheFromSession
(TokenCache.java:72)
	
org.apache.myfaces.trinidadinternal.application.StateManagerImpl._getViewCac
he(StateManagerImpl.java
:548)
	
org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveSeriali
zedView(StateManagerImpl.java:265)
	javax.faces.application.StateManager.saveView(StateManager.java:47)
	
org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter
.flushToWriter
(JspViewHandlerImpl.java:387)
	
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHand
lerImpl.java:322)
	
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.jav
a:45)
	
org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
(ViewHandlerImpl.java:174)
	
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176
)
	
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.jav
a:45)
	
org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView
(ViewHandlerImpl.java:174)
	
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176
)
	
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseEx
ecutor.java:41)
	org.apache.myfaces.lifecycle.LifecycleImpl.render
(LifecycleImpl.java:132)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)

tiles-defs.xml

<tiles-definitions>

	<!--
=================================================================== -->

	<!-- Master definition
-->
	<!--
=================================================================== -->

	<!-- Doc index page description  -->

	<definition	name="test"	template="/page/layout.jsp">
		<put-attribute	name="header"	value="/tile/header.jsp"/>
		<put-attribute	name="footer"	value="/tile/footer.jsp"/>

	</definition>

</tiles-definitions>

faces-config.xml

<faces-config
		xmlns="http://java.sun.com/xml/ns/javaee
"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
		version="1.2">

	<application>
		<!-- Tiles Integration -->

	
<view-handler>org.apache.shale.tiles.TilesViewHandler</view-handler>
	</application>

</faces-config>

web.xml

<web-app	xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
			xmlns="http://java.sun.com/xml/ns/javaee"
			xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
			id="WebApp_ID"
			version="2.5">
	<display-name>tiles</display-name>


	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>
default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>

    <context-param>
        <param-name>
javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
        <description>
            State saving method: "client" or "server" (= default)

            See JSF Specification 2.5.2
        </description>
    </context-param>

	<!-- Tiles -->
	<context-param>
		<param-name>definitions-config</param-name>

		<param-value>/WEB-INF/tiles-defs.xml</param-value>
	</context-param>

    <!--context-param>
        <param-name>org.apache.tiles.CONTEXT_FACTORY</param-name>
        <param-value>
org.apache.tiles.context.enhanced.EnhancedContextFactory</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.tiles.CONTAINER_FACTORY.mutable</param-name>

        <param-value>true</param-value>
    </context-param-->

	<listener>
	
<listener-class>org.apache.tiles.listener.TilesListener</listener-class>
	</listener>


	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
	
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>

	</servlet>

	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.tiles</url-pattern>
	</servlet-mapping>

</web-app>

layout.jsp

<html>
	<head><title>Tiles Quickstart</title><head>
	<body>
		<tiles:insertAttribute	name="header"/>

		<div id="body">
			Tiles 101 body content.
		</div>

		<tiles:insertAttribute	name="footer"/>
	</body>
</html>