Liferay 6 / jBoss 有一个“简单”的方法吗?有干净的网址的方法吗?

发布于 2024-10-05 23:18:13 字数 663 浏览 0 评论 0原文

我正在使用 Coldfusion 9,在 jBoss/Liferay 6 下运行。

一切都很好,我已经开发了相当多的 portlet,我已经解决了这些问题(当我遇到一些我通常可以直接处理的问题时) 。总体而言,Coldfusion 9 portlet 在 Liferay 内部运行得非常好。

我真正不喜欢的一件事是,这些 URL 太不可读了,我真的希望我的应用程序有干净的 URL,所以当用户搜索并返回结果时,我可以让他们单击像 http 这样的链接: //liferaysite.com/web/viewitem/ABC123

目前,我得到了一个参差不齐的 URL,其中包括 portlet 状态、属性、与我传递的变量关联的 portlet ID(通常是 portlet id + 变量的组合)以及其他不需要的垃圾。

有没有任何“简单”的方法来获取干净的网址?我的问题是我不是一个 JAVA 人,所以我不太有信心深入研究 jBoss/Liferay 代码来完成一些事情。不过,我觉得 Liferay 足够“免提”,因此我可以构建我的 portlet 并部署它们,而无需修改 JAVA 代码和弄脏。

有什么想法吗?我找不到很多关于这方面的文章,特别是因为 Liferay 6 太新了,而且很少有人发布有关它的内容。也许这会是 Jboss 中的某种 URL 重写?

谢谢您,感谢所有建议:)

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 :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

还在原地等你 2024-10-12 23:18:13

简短的答案是使用 URL 重写来实现这一点,并将 Liferay URL 转换为您想要的任何形式。我认为有两种可能性可以做到这一点:

  1. 将 Apache Web 服务器放在 Liferay 服务器前面并使用 mod_rewrite
  2. 使用 URL 重写过滤器已包含在 Liferay 中,因为它模仿了 mod_rewrite 的功能,无需额外的 Apache 服务器

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
半世晨晓 2024-10-12 23:18:13

您可能对FriendlyUrlMappers 感兴趣。有关基础知识,请参阅此博客文章

至于“容易”,你必须自己判断。门户的本质,例如在单个页面上组合完全不同且独立的应用程序(portlet),会导致您失去对 URL 的控制(默认情况下),因为门户必须消除很多内容的歧义。为了重新获得控制权,您需要做一些工作,FriendlyUrlMappers 强加了一些工作,但结果是值得的恕我直言。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文