Dims
Dims

Reputation: 51039

How to make Liferay not produce condensed HTML code?

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?

Upvotes: 8

Views: 6599

Answers (5)

cnr..
cnr..

Reputation: 81

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

com.liferay.portal.servlet.filters.strip.StripFilter=false

Upvotes: 1

experimenter
experimenter

Reputation: 778

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

Upvotes: 12

Sandeep Nair
Sandeep Nair

Reputation: 3650

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

Upvotes: 6

Olaf Kock
Olaf Kock

Reputation: 48057

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.

Upvotes: 1

Fabian Barney
Fabian Barney

Reputation: 14549

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.

Upvotes: 10

Related Questions