Jean Luc Sossmeier created MYFACES-4056:
-------------------------------------------

             Summary: 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.10, 2.2.9
         Environment: Windows 8.1, Netbeans 8.1, 
            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)

Reply via email to