DEVCON 2026    |    2-5 November 2026 – QEII Centre – London, UK    |    Register now! 

Blogs

URL shortener for Liferay

David Kubitza
David Kubitza
阅读少于一分钟

At this year's Liferay DevCon, Suraj Bihari had an interesting session about short URLs. As I was about to do something like this anyway, I decided to make it public from the beginning.

 

And now everyone can have a look at the result: Ancud ShortURL Portlet

 

Technically, it's a really simple Liferay MVC Service Builder portlet built with Ant and extended by a Servlet Filter Hook, which will do the redirection. It has some permission settings to define who may add and manage links and a basic front end, that's it.

When creating new URLs, the portlet will generate an identifier made of 10 alphanumeric characters. You can use this or override it by your own custom identifier. Then, just add the URL to be redirected to and you're ready to share! Whenever someone tries to invoke your portal with the identifier, the Servlet Filter will redirect to the destination URL. So you can build your own goo.gl/bit.ly.

 

The whole project is free of charge and totally open source, so check out how easy it works. :)

页面评论

I put a feature request for Liferay to have its own service in DXP. Link rot is the worst when it come to linking to documents. Threads are also ugly URL's and having this service allows for analytics to be gained on a user by user basis.

 

A broken destination URL can also be fixed because the short URL can be managed and edited by portal admins, thus you'd see a lot less 404.

 

Like why hasn't this been done already?  

https://issues.liferay.com/browse/LPS-112211

Related Assets...

未找到结果

More Blog Entries...

David H Nebinger
九月 28, 2026
David H Nebinger
九月 25, 2026
David H Nebinger
九月 23, 2026