Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-3384

Custom JSF Resource subclasses return null for getURL()

    Details

      Description

      All the example and production custom JSF Resource subclasses implement the getURL() method to return null:

      @Override
      public URL getURL() {
      	return null;
      }
      

      Instead these methods should return the encoded URL. For example, something like the following code could be used:

      @Override
      public URL getURL() {
      
      	try {
      		return new URL(FacesContext.getCurrentInstance()
      			.getExternalContext().encodeResourceURL(getRequestPath()));
      	}
      	catch (MalformedURLException e) {
      		return null;
      	}
      }
      

      There are also places where resource.getRequestPath() is used when resource.getURL().toString() should be used instead. That problem should be fixed as part of this ticket.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Packages

                Version Package
                bridge-impl-4.2.1
                portal-3.1.1
                alloy-3.0.3