开发者

Liferay 6 / jBoss is there an 'easy' way to have clean urls?

I am working with Coldfusion 9, running under jBoss/Liferay 6.

All is well, I have developed quite a few portlets that I have made work around for (when I run into some issues that I could usually handle in a straight forward fashion). Overall Coldfusion 9 portlets work very well inside of Liferay.

One thing I really dislike is that the URLs are so unreadable, and I was really hoping for clean urls for my application, so when a user searches, and the result comes back, I can have them click a link like http://liferaysite.com/web/viewitem/ABC123.

Currently I get a raggedy URL that includes portlet status, properties, the portlet ID associated with the variable that I am passing (usually a combination of portlet id + variable) and other garbage that is un-needed.

Is there any 'easy' way to get clean URLs? My issue is that I am not a JAVA person, so I am not too confidant in digging into jBoss/Liferay code to get something done. However I feel that Liferay is sufficiently 'hands-free' so that I can build my portlets and deploy them without modifying JAVA code and getting dirty.

Any ideas? I am not able to find many articles on this, especially since Liferay 6 is so new, and there are so few people posting things about it. Maybe this would be some sort of URL rewriting in Jboss?

Thank 开发者_高级运维you, appreciate any and all suggestions :)


The short answer is to use URL rewriting to achieve this and transform Liferay URLs to any form you want. There are 2 possibilities I see to do this:

  1. Put an Apache web server in front of your Liferay server and use mod_rewrite
  2. Use the URL rewriting filter that is already included in Liferay as this mimics what mod_rewrite does without the requirement of an extra Apache server


You might be interested in FriendlyUrlMappers. See this blog entry about the basics.

Regarding the "easy" you have to judge about that yourself. The nature of portals, e.g. combining completely different and independent applications (portlets) on a single page bring with it that you loose control over URLs (by default), because the portal has to disambiguate quite a lot of stuff. In order to get back control, you need to do some work, FriendlyUrlMappers impose some work, but the result is worth it IMHO.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜