8

I found that Liferay transfers my JSP code in a somehow "condensed" way -- putting most of the text into a few very long lines.

This makes it uncomfortable to debug javascript.

Is it possible to turn off this feature temporary?

Community
  • 1
  • 1
Dims
  • 47,675
  • 117
  • 331
  • 600

5 Answers5

12

For others looking at this post, if you simply want to do this on an adhoc basis you can add these params to the URL:

/web/guest/page?js_fast_load=0&css_fast_load=0&strip=0

Note this is for JS, CSS and HTML

experimenter
  • 768
  • 1
  • 9
  • 30
10

HTML Minification is on regardless you're in developer mode or not since HTML stripping can itself produce problems you want to see in developer mode.

You can add strip=0 parameter to the URL to prevent the served HTML page being stripped.

In order to turn HTML-Stripping completely off change in your system.properties:

com.liferay.filters.strip.StripFilter=false

But as @BalusC said you should use a tool which does the formatting when debugging. So you're not bothered by the stripping.

Fabian Barney
  • 14,219
  • 5
  • 40
  • 60
6

There are two ways to do it. Copy the following in portal-ext.properties and restart the server

javascript.fast.load=false

or If you dont want to restart and its just for temporary purpose add js_fast_load parameter to url and set its value to false.

For example if you are in a page http://localhost:8080/web/guest/home in which your portlet or the javascript is present. Use this url instead http://localhost:8080/web/guest/home?js_fast_load=0

AdrianRM
  • 2,622
  • 2
  • 25
  • 42
Sandeep Nair
  • 3,630
  • 3
  • 26
  • 38
  • 1
    This is only for JS-Files, isn't it? I am not sure, but I think OP worries about debugging Javascript that is inside HTML-Code and not in separate files. – Fabian Barney Jan 11 '12 at 11:02
1

I just want to update package name for Liferay 6.2 from @Fabian Barney's answer:

com.liferay.portal.servlet.filters.strip.StripFilter=false
cnr..
  • 51
  • 5
1

Liferay has a file named portal-developer.properties as template in WEB-INF/classes. You can either reference this or just copy/paste the content into your portal-ext.properties.

This has several options to minify html, js, css and others. You'll kill your loading time - i.e. you really only want these options at development time, but then it really helps.

By default all files are also combined into a single one (for js, another for css etc.) - with the development options you'll get a separate request for every file on every page request.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90