Liferay 6 / jBoss 有一个“简单”的方法吗?有干净的网址的方法吗?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简短的答案是使用 URL 重写来实现这一点,并将 Liferay URL 转换为您想要的任何形式。我认为有两种可能性可以做到这一点:
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:
您可能对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.