public class WebJarServer extends Object implements Serializable
By default, webJars are enabled for development mode and disabled for
production mode. There is a way to override this behavior by setting
Constants.DISABLE_WEBJARS
param.
Constructor and Description |
---|
WebJarServer(DeploymentConfiguration deploymentConfiguration)
Creates a webJar server that is able to search webJars for files and
return them.
|
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getWebJarResourcePath(String filePathInContext)
Gets web jar resource path if it exists.
|
boolean |
tryServeWebJarResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Searches for file requested in the webJars.
|
public WebJarServer(DeploymentConfiguration deploymentConfiguration)
deploymentConfiguration
- configuration for the deployment, not null
public boolean tryServeWebJarResource(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
request
- the servlet requestresponse
- the servlet responsetrue
if response was populated with webJar contents,
false
otherwiseIOException
- if response population failspublic Optional<String> getWebJarResourcePath(String filePathInContext)
filePathInContext
- servlet context path for fileCopyright © 2019. All rights reserved.