Class BaseURLAttributeSetter

java.lang.Object
io.github.jirkasa.servletrouter.Middleware<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
io.github.jirkasa.servletrouter.HttpMiddleware
io.github.jirkasa.servletrouter.BaseURLAttributeSetter
All Implemented Interfaces:
Handler<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>

public class BaseURLAttributeSetter extends HttpMiddleware
Middleware that sets base URL attribute to request. By default it is named "BASE_URL", but that can be changed by passing name to constructor.
  • Constructor Details

    • BaseURLAttributeSetter

      public BaseURLAttributeSetter()
      Creates new middleware that sets "BASE_URL" attribute to request.
    • BaseURLAttributeSetter

      public BaseURLAttributeSetter(String baseURLAttributeName)
      Creates new middleware that sets base URL attribute to request.
      Parameters:
      baseURLAttributeName - Name of attribute.
  • Method Details

    • handle

      public boolean handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
      Description copied from interface: Handler
      Handles request.
      Parameters:
      request - Request to be handled.
      response - Response to be handled.
      Returns:
      Determines whether handlers chain should continue or not.
      Throws:
      Exception