gamerson / liferay-jsp-spy

Apache License 2.0
13 stars 5 forks source link

SPY comments not inserted despite active jsp-spy module #8

Closed nicolas-raoul closed 5 years ago

nicolas-raoul commented 5 years ago

As can be seen in this screenshot, the jsp-spy module is Active, but the HTML does not contain any SPY comments, even after refreshing:

Screenshot from 2019-04-12 16-04-29

I only having this Liferay server on my machine, so I am sure I did not deploy to the wrong one.

gamerson commented 5 years ago

hey @nicolas-raoul do you have the direct.context.servlet.enabled=false set?

nicolas-raoul commented 5 years ago

Yes, here is my full portal-ext.properties (I restarted the Liferay server many times since configuring that):

# For JSP Spy https://github.com/gamerson/liferay-jsp-spy
include-and-override=portal-developer.properties
direct.servlet.context.enabled=false

# Developer mode
include-and-override=portal-developer.properties

# Avoid "Running validation because of mismatched checksum"
module.framework.properties.lpkg.index.validator.enabled=false
gamerson commented 5 years ago

That looks correct. And I just tested this with 7.1 DXP SP1 with those same settings with the jsp spy activated and I see the SPY comment nodes in the source. Can you enable logging for the jsp-spy module and then see what it shows?

Screen Shot 2019-04-15 at 5 07 17 PM
gamerson commented 5 years ago

When I enable that on DXP SP1 I get this in the logs.


2019-04-15 22:06:55.833 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_content/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.834 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/start.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.836 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/end.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.837 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_body/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.839 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.841 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.842 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.843 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_content/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.845 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/start.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.846 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/end.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.847 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_body/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.848 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.849 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_content/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.850 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/start.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.851 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/end.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.852 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_body/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.854 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.856 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.857 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.858 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.859 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_content/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.860 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/start.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.861 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category/end.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.862 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_category_body/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.863 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.865 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.866 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel_app/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.867 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.application.list.taglib/portlet/view.jsp->/panel/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.871 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _/html/common/themes/portal.jsp->/html/common/themes/top_head.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.872 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.document.library.analytics/dynamic_include/top_head.jsp->/dynamic_include/top_head.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.874 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.ratings.analytics/dynamic_include/top_head.jsp->/dynamic_include/top_head.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.875 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.comment.analytics/dynamic_include/top_head.jsp->/dynamic_include/top_head.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.875 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _com.liferay.social.bookmarks.analytics/dynamic_include/top_head.jsp->/dynamic_include/top_head.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.876 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _/html/common/themes/portal.jsp->/html/taglib/ui/quick_access/page.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.877 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _/html/common/themes/portal.jsp->/html/common/themes/body_top.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.878 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _/html/common/themes/portal.jsp->/html/portal/layout.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.878 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _/html/common/themes/portal.jsp->/html/common/themes/body_bottom.jsp _ -->_ [Sanitized]
2019-04-15 22:06:55.879 DEBUG [http-nio-8080-exec-5][JspSpyServletFilter:65] _<!--SPY _/html/common/themes/portal.jsp->/html/common/themes/bottom.jsp _ -->_ [Sanitized]```
nicolas-raoul commented 5 years ago

I can see the SPY comments in catalina.out, and now I can see them in the HTML file too! I am not sure what happened 4 days ago, but it was probably my fault. In particular, I mistakenly thought that a SPY comment would appear above each <div> explaining from what JSP that element was generated by; now I understand that the SPY comment only appears once per JSP inclusion. Sorry for wasting your time! Screenshot from 2019-04-16 11-24-07

gamerson commented 5 years ago

No problem! I am thinking about how we can make it so that more elements have SPY comments that show the JSP they were rendered from. It may require some dynamic taglib includes as another idea.

On Mon, Apr 15, 2019 at 9:29 PM Nicolas Raoul notifications@github.com wrote:

I can see the SPY comments in catalina.out, and now I can see them in the HTML file too! I am not sure what happened 4 days ago, but it was probably my fault. In particular, I mistakenly thought that a SPY comment would appear above each

explaining from what JSP that element was generated by; now I understand that the SPY comment only appears once per JSP inclusion. Sorry for wasting your time! [image: Screenshot from 2019-04-16 11-24-07] — You are receiving this because you commented. Reply to this email directly, view it on GitHub , or mute the thread .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com