You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Jean Luc Sossmeier (JIRA)" <de...@myfaces.apache.org> on 2017/02/07 19:02:41 UTC

[jira] [Commented] (MYFACES-4056) ViewRoot update ignores class attribute

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

Jean Luc Sossmeier commented on MYFACES-4056:
---------------------------------------------

Leonardo, thank you very much for your time.

I had a deffered panel in my page that was intercepted checking if the user has permission to view it.
If the user did not had the authorization, the interceptor would throw an Exception that was filtered and redirected to an specific forbidden page.

The problem is that the deferred panel was loaded using an XHR request, and redirecting while the XHR hasn't really loaded everything seems to be illegal thus causing an javascript error and resulting in the bug - Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/

As you've said, it is notan MyFaces issue.
Keep you the great job.

> 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
>            Assignee: Leonardo Uribe
>
> 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.15#6346)