Package io.github.jirkasa.servletrouter
Interface Handler<Request extends javax.servlet.ServletRequest,Response extends javax.servlet.ServletResponse>
- Type Parameters:
Request
- Type of ServletRequest.Response
- Type of ServletResponse.
- All Known Implementing Classes:
BaseURLAttributeSetter
,HttpMiddleware
,HttpRouter
,Middleware
,Router
public interface Handler<Request extends javax.servlet.ServletRequest,Response extends javax.servlet.ServletResponse>
Represents component that handles requests. Can be registered in
Router
which is also a handler.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Handles request.boolean
Determines whether handler should be called when full request path matches or not.void
setPathParams
(Map<String, String> pathParams) Sets path parameters.
-
Method Details
-
handle
Handles request.- Parameters:
request
- Request to be handled.response
- Response to be handled.- Returns:
- Determines whether handlers chain should continue or not.
- Throws:
Exception
-
setPathParams
Sets path parameters.- Parameters:
pathParams
- Map of path parameters.
-
matchesFullPath
boolean matchesFullPath()Determines whether handler should be called when full request path matches or not.- Returns:
- True indicates that full request path should match path of handler. False indicates that just start of request path should match path of handler.
-