myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-4056) ViewRoot update ignores <body> class attribute
Date Tue, 09 Aug 2016 20:01:20 GMT

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

Leonardo Uribe commented on MYFACES-4056:
-----------------------------------------

Thanks for your words about MyFaces. I have checked the problem and I don't see anything that
could cause the problem from MyFaces side. I tried:

{code:xml}
<body class="#{facesContext.partialViewContext.partialRequest ? 'myclass' : ''}">
...
            <h:commandButton value="Update">
                <f:ajax render="@all"/>
            </h:commandButton>
{code}

And the body was updated as expected, so the javascript code is doing the replacement correctly.
It could be an error on the template or some side effect from Ommifaces. 

Since I have not found enough evidence, I have to close this one as cannot reproduce. Please
reopen it again if you can provide an example.

> ViewRoot update ignores <body> class attribute
> ----------------------------------------------
>
>                 Key: MYFACES-4056
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4056
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.2.9, 2.2.10
>            Reporter: Jean Luc Sossmeier
>
> I have an Apache Shiro interceptor setup that validates user actions, and if user is
not yet authenticated it throws an {{UnauthenticatedException}}. As the actions validated
may be ajax actions, I also used the Omnifaces {{FullAjaxExceptionHandler}} (which is not
where the bug is coming from, it works just as expected).
> So I have setup in {{web.xml}} an error-page for the exception, so it redirects to the
login page when a UnauthenticatedException is thrown.:
> {quote}
>     <error-page>
>         <exception-type>org.apache.shiro.authz.UnauthenticatedException</exception-type>
>         <location>/login.xhtml</location>
>     </error-page>
> {quote}
> So when I try to make an action that requires authentication, my interceptor manages
it and throws and {{UnauthenticatedException}}, then omnifaces {{FullAjaxExceptionHandler}}
handles the exception, looking up the error page assigned for the exception which is {{/login.xhtml}}
and  updates the {{ViewRoot}} with the following response:
> {quote}
> <?xml version="1.0" encoding="UTF-8"?>
> <partial-response id="j_id__v_0"><changes>
> <update id="javax.faces.ViewRoot"><![CDATA[<!DOCTYPE html>
>   <html xmlns="http://www.w3.org/1999/xhtml"><head id="j_id_3">
>      <!-- Ommited -->
>      <title>Entrar</title></head>*<body class="loginbody">*
>      <!-- Ommited  -->
> </changes></partial-response>
> {quote}
> Now please check that the final HTML rendered from the ViewRoot partial-response update
does not have the {{loginbody}} class:
> {quote}
> <!-- ommited -->
> *<body>*
>         <div class="Wid25 MarAuto DispBlock OvHidden Responsive100">
> <!-- ommited -->
> {quote}
> As the partial-response originally had the class but the view rendered does not have
it, I assume that this is a MyFaces issue.
> Thank you so much for your great work, I love MyFaces.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message