myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ganesh <>
Subject MyFaces 2.0 AJAX html stripper regexps
Date Tue, 21 Apr 2009 08:12:41 GMT
Hi Werner,

After some testing with <\s*html[^>]*>(.*)<\/\s*html[^>]*> I couldn't 
get it to work properly. Instead  I used

            var htmlStartEx = /<\s*html[^>]*>/gi;
            var htmlEndEx = /<\/\s*html[^>]*>/gi;

and substring similar to Mojarra (same for head and body). Your approach 
would be a lot cooler, but, as I said, it doesn't work for me. Maybe you 
can get it to run?

The jsdocs and Mojarra want only the body CONTENTS replaced, omitting 
the body tag's attributes. I see this as a bug and used replaceHtmlItem 
to replace the entire body including the body tag for the patch. If you 
can get your strippers to run, they will probably need some adjustment 
to include the the tags, not only their contents.

Here is how I tested it: I renamed scriptTest.html to scriptTest.xhtml 
and made it a JSF page. Then I modified index.xhtml to contain a button 
that navigates to scriptTest.xhtml and ajaxified it. The server now 
responds with a javax.faces.ViewRoot and replaces the complete contents 
of index.xhtml with the contents of scriptTest.xhtml - works great :-)

Best Regards,

View raw message