0

What is the role of the getStaticResourceURL() method?

If I pass request.getContextPath() + mypath to it (without a timestamp), what it can change? If I pass some timestamp, what it can change additionally?

Dims
  • 47,675
  • 117
  • 331
  • 600
  • You need to provide some more information, e.g. where that method is located etc. Did you read the documentation already? – Thomas Dec 29 '11 at 09:43
  • Documentation is empty as it usual for Liferay: http://docs.liferay.com/portal/6.0/javadocs/com/liferay/portal/util/PortalUtil.html#getStaticResourceURL(javax.servlet.http.HttpServletRequest, java.lang.String) I found this method in some sample code, it was used to calculate paths of images in portlet JSP; but simple contextpath+mypath also worked for me; so I wonder what does it actualy does and in which circumstances – Dims Dec 29 '11 at 09:51

1 Answers1

3

The method will add a few (undocumented) parameters to the URL:

  1. browserId - a friendly name for the browser like "firefox"
  2. themeId - the Liferay ThemeId (only for css and jsp files)
  3. colorSchemeId - the color scheme id (only for jsp files)
  4. minifierType - the minifier type (js or css)
  5. languageId - the language id from the Theme
  6. b - the Liferay Build Number
  7. t - the timestamp for the theme (or the file if it's a /html/* file)

The only place I could find this was in the source code

dough
  • 714
  • 5
  • 14
  • Updated link: https://github.com/liferay/liferay-portal/blob/3d5c930c3f8d784099c28e70463cd87a048cb64e/portal-impl/src/com/liferay/portal/util/PortalImpl.java#L5263 – Itaypk Aug 28 '19 at 17:20