jspjbossjstlportletjboss-portal

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


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";
}

Solution

  • 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");