Liferay六年中持续被评为Gartner水平门户魔力象限领导者。 原因是

Web Proxy Portlet

Introduction #

The Web Proxy portlet allows showing any website (or any content accessible using HTTP) as if it was a portlet. It's based on the Portlet Bridge project ( version 1.1.2.

Features #

The following features are provided thanks to the portlet bridge project:

  • Getting content from a downstream site
  • Proxy configuration (including NTLM and Basic authentication)
  • NTLM and Basic authentication as preferences
  • Using an xsl stylesheet to rewrite the content from the downstream site
  • Proxying of remote resources (e.g. images, flash etc.)
  • Regular expression defining which URL's are in the portlet and which should be regular links
  • XSL Stylesheets packaged as part of the portlet or remote (URL based)
  • Links to binary files
  • Rewriting CSS urls
  • Moving javascript and css links out of the head
  • Hiding of downstream URLs and configurable scope
  • Back button and refresh support
  • Base tag support
  • Pluggable authentication
  • Configurable regular expressions for Javascript and CSS rewriting


The Liferay Portal integration adds the following on top of this:

  • Configuration through the Web UI of:
    • URL of the remote site/content
    • Scope of links to be rewritten
    • Proxy configuration
    • XSL to transform the content

Deploying the web proxy portlet #

The portlet is already installed on standard installations.

Have a look at the "Sample" category.

Deploying portlet bridge manually #

Some times it might be desired to install portlet bridge manually instead of using the Web Proxy portlet provided by Liferay. This could be the case if you have modified the source code or if there is a newer version than the one provided by Liferay.

While portletbridge comes prepared to be installed in Liferay it's not been adapted to its latest version, so there are a few extra steps needed. Note that you may need to change the version numbers used below to correspond to the ones of the version of Liferay you are using:

1. Download the .war file and extract its content to some folder, eg with:

 jar xvf portletbridge-portlet.war

2. Modify WEB-INF/liferay-display.xml by changing the DTD from

 <!DOCTYPE display PUBLIC "-//Liferay//DTD DISPLAY 2.0.0//EN" "">


 <!DOCTYPE display PUBLIC "-//Liferay//DTD Display 4.0.0//EN" "">
 <!--<!DOCTYPE display PUBLIC "-//Liferay//DTD DISPLAY 2.0.0//EN" "">-->

3. Modify WEB-INF/liferay-portlet.xml by changing the DTD from

 <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 3.5.0//EN" "">


 <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.3.0//EN" "">
 <!--<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 3.5.0//EN" "">-->

4. Repackage all the content with the modified files, eg through:

 jar cvf portletbridge-portlet.war *

5. Deploy the .war file onto liferay

Note: the jar command is an executable that comes with your Java VM, you may need to install a Java SDK to make that program available to you.

Configuration #

Enter the URL that the portlet shall show as default.

The scope is a regular expression matched to the absolute URL of the target of a link. If the expression matches, the link is rewritten such that the request goes to the proxy portlet, and the next page would show up inside the portlet. If the expression does not match, the link is not rewritten, so the browser would get the original link and may show the next page without using the proxy portlet and portal. If the browser cannot access the referenced page without a proxy inbetween following that link is impossible (and maybe that is what you want).

You may enter an XSL-T stylesheet (no url or filename, the stylesheet itself) if you want the pages to be processed while the content is proxied. You can use this if e.g. you want to hide some parts (e.g. remove all the links that cannot be followed through the proxy anyway).

References #

The Web Proxy Portlet is one of Liferay's Out of The Box Portlets

0 附件
99452 查看
平均 (2 票)
满分为 5,平均得分为 4.0。
讨论主题回复 作者 日期
hullo, i've tried the web proxy portlet but it... demonz elevenb 2012年2月23日 下午1:54
Hi, it doesn't work for Liferay 6.2 maher megadmini 2014年10月17日 上午7:44

hullo, i've tried the web proxy portlet but it refused to work. I just added the URL of an existing webapp and nothing shows up. (strangely, works)

However, with the "iframe" plugin, things work fine.

any suggestions?
在 12-2-23 下午1:54 发帖。

it doesn't work for Liferay 6.2
在 14-10-17 上午7:44 发帖。