myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonardo Uribe <lu4...@gmail.com>
Subject Re: Adding web debug feature to include files
Date Mon, 19 May 2014 15:35:22 GMT
Hi

I think it is possible. To do that, you can take a look at the class
org.apache.myfaces.view.facelets.compiler.CompilationManager method
pushTag(Tag orig).

The idea is SAXCompiler parses the xml file and use CompilationManager
to create a set of instructions that later will be used to create the
facelet abstract syntax tree (AST), which is a hierarchy of facelet
tags that later generate a JSF component tree. In this point you can
detect when a ui:include or ui:decorate or ui:composition is used and
add the comment, adding a new TextUnit and calling writeComment(...)
method. Probably you should need to add some code on
org.apache.myfaces.view.facelets.compiler.Compiler class and
org.apache.myfaces.view.facelets.compiler.loadOptions(...) method to
include the config param, just look how "facelets skip comments"
parameter is defined and follow the pattern.

If you provide a patch I can take a look at it, and if it is ok, I'll
commit it for 2.2.x branch. Please create an issue of this improvement
in:

https://issues.apache.org/jira/browse/MYFACES

regards,

Leonardo Uribe

2014-05-16 14:35 GMT+02:00 Karl Trumstedt <karltru@gmail.com>:
> Hi,
>
> I'm thinking that it would be a nice debug feature in myfaces when in
> development mode if myfaces automatically could append the filename of
> include files as an html comment.
>
> We have large pages with many small includes, and when looking at the page
> it would be nice to be able to use the browser development tools to quickly
> inspect the html code and see which file this chunk of HTML comes from.
> Instead of having to back track through XHTML pages and templates just to
> locate the correct include file.
>
> Would this be possible? Any idea where in the code I should begin to look to
> implement this?
>
>
>
>
>
>

Mime
View raw message