Class WebJar


public class WebJar extends ContextBean

Resolves a version-less WebJar resource path to a servable URL and writes it to the output (or stores it in a variable when var is set). Compose it with <s:script>/<s:link> or a raw <link>/<script> element.

Examples
   <link rel="stylesheet" href="<s:webjar path="bootstrap/css/bootstrap.min.css" />" />
   <@s.webjar path="jquery/jquery.min.js"/>
 
  • Field Details

    • path

      protected String path
  • Constructor Details

    • WebJar

      public WebJar(ValueStack stack, jakarta.servlet.http.HttpServletRequest request)
  • Method Details

    • setWebJarUrlProvider

      public void setWebJarUrlProvider(WebJarUrlProvider webJarUrlProvider)
    • end

      public boolean end(Writer writer, String body)
      Description copied from class: Component
      Callback for the end tag of this component. Should the body be evaluated again?
      NOTE: will pop component stack.
      Overrides:
      end in class Component
      Parameters:
      writer - the output writer.
      body - the rendered body.
      Returns:
      true if the body should be evaluated again
    • setPath

      public void setPath(String path)