Class ResponseHeaderService
java.lang.Object
sk.iway.iwcm.components.response_header.rest.ResponseHeaderService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
getResponseHeaders
(String url) static boolean
isPathCorrect
(String path, String url) Check if path is correct for URL, it accepts path in format - /path/subpath/ - use startsWith - /path/subpath/*.pdf - use startsWith for /path/subpath/ and endsWith for *.pdf - /path/subpath/*.pdf,*.jpg - use startsWith for /path/subpath/ and endsWith for *.pdf or *.jpg - ^/path/subpath/$ - use equalsstatic void
setContentLanguageHeader
(String lngContryPair, boolean forceSet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Set Content-Language header, also set response.setLocalestatic void
setResponseHeaders
(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Set HTTP headers for path
-
Constructor Details
-
ResponseHeaderService
public ResponseHeaderService()
-
-
Method Details
-
getResponseHeaders
-
deleteDomainCache
public static void deleteDomainCache() -
setResponseHeaders
public static void setResponseHeaders(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Set HTTP headers for path -
setContentLanguageHeader
public static void setContentLanguageHeader(String lngContryPair, boolean forceSet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Set Content-Language header, also set response.setLocale- Parameters:
lngContryPair
- - pair eg sk-SK, cs-CZ, en-GBforceSet
- - set to true to owerwrite previously set valuerequest
-response
-
-
isPathCorrect
Check if path is correct for URL, it accepts path in format - /path/subpath/ - use startsWith - /path/subpath/*.pdf - use startsWith for /path/subpath/ and endsWith for *.pdf - /path/subpath/*.pdf,*.jpg - use startsWith for /path/subpath/ and endsWith for *.pdf or *.jpg - ^/path/subpath/$ - use equals- Parameters:
path
- - path to testurl
- - URL address to test- Returns:
-