[ 
https://issues.apache.org/jira/browse/MYFACES-4267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16698802#comment-16698802
 ] 

Antgar commented on MYFACES-4267:
---------------------------------

template.xhtml
{code:java}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
    xmlns:c="http://java.sun.com/jsp/jstl/core";
    xmlns:h="http://xmlns.jcp.org/jsf/html";
    xmlns:f="http://xmlns.jcp.org/jsf/core";
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets";>

  <f:view transient="true">

    <h:body>
        Log in:
        <ui:insert name="body" />
    </h:body>
  </f:view>
</html>
{code}
login.xhtml
{code:java}
<ui:composition xmlns="http://www.w3.org/1999/xhtml";
    xmlns:c="http://java.sun.com/jsp/jstl/core";
    xmlns:h="http://xmlns.jcp.org/jsf/html";
    xmlns:f="http://xmlns.jcp.org/jsf/core";
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets";
    template="template.xhtml">

  <ui:define name="body">

    <h:form prependId="false">
        <h:inputText id="username" required="true" />
        <h:inputSecret id="password" required="true" redisplay="true" />
        <h:commandButton value="Login" action="#{loginManager.doLogin}" />
    </h:form>
  </ui:define>
</ui:composition>
{code}
This gives an "unable to create view /login.xhtml" until you include this at 
login.xhtml:
{code:java}
  <f:metadata>
    <f:view transient="true" />
  </f:metadata>
{code}

> transient attribute is not inherited from template to final page.
> -----------------------------------------------------------------
>
>                 Key: MYFACES-4267
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4267
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: Extension Feature
>    Affects Versions: 2.3.2
>            Reporter: Antgar
>            Priority: Critical
>
> After upgrading from Myfaces 2.2 to 2.3, templated transient views stop to 
> work, raising "unable to create views" exceptions.
> f:view transient attribute defined in a template seems not to be inherited by 
> the final page correctly. With myfaces 2.2 it worked correctly, but in 2.3, 
> there is a new check 
> {code:java}
> if (!view.isTransient()) ...
> {code}
> on FaceletViewDeclarationLanguage line 2128. On page restoring, transient 
> appears as false.
> A workaround is to set transient="true" on the final page too. Other option 
> is to use a block 
> {code:java}
> <f:metadata><f:view transient="true" /></f:metadata>
> {code}
> on the final page (f:metadata doc says it shouldn't be used in templates).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to