Accessing your portlet's namespace in EL

We know Liferay is not the most EL friendly piece of software out there, but lots of people do like to be able to user EL. In this post I will show you a simple way to access your portlet namespace using EL, and better yet, get rid of the numerous <portlet:namespace/> that are usually scattered around.

The ideal is simple: just put it in a variable using <c:set>.

Let's see this in action via this extremely simple snippet.


<c:set var="namespace" >
   <portlet:namespace/>
</c:set>

That is it, you can now start using ${namespace} whenever you need it. Like in this example.


<c:param name="${namespace}namespace" value='${namespace}'/>

More Blog Entries

0 Comments