How to assign values to the parameters of <portlet:resourceURL/>?

abg picture abg · Jul 27, 2012 · Viewed 8.3k times · Source

I'm trying to assign values to the parameters of <portlet:resourceURL/>

<portlet:resourceURL id="<%=Constants.Color%>" var="<%=Constants.Color%>"/>

This code does not work.

public class Constants {
    public static final String Color = "Red";
}

Answer

mod picture mod · Sep 17, 2012

In order to pass param using resourceURL from your jsp you will do something like...

      <portlet:resourceURL var="varname" escapeXml="false">
        <portlet:param name="paramName" value="paramVal" />
      </portlet:resourceURL>

In your portlet

      request.getParameter("paramName");