Package com.deere.isg.worktracker.spring
Class SpringWork
- java.lang.Object
-
- com.deere.isg.worktracker.Work
-
- com.deere.isg.worktracker.servlet.HttpWork
-
- com.deere.isg.worktracker.spring.SpringWork
-
public class SpringWork extends HttpWork
An implementation ofHttpWork. Spring Projects should use this class as their base work (i.e. providing an implementation forupdateUserInformation(HttpServletRequest)) since this provides features that are specific to Spring.
-
-
Field Summary
Fields Modifier and Type Field Description static StringENDPOINT-
Fields inherited from class com.deere.isg.worktracker.servlet.HttpWork
ACCEPT, ACCEPT_HEADER, PATH, REMOTE_ADDRESS, REMOTE_USER, SESSION_ID, STATUS_CODE
-
-
Constructor Summary
Constructors Constructor Description SpringWork(javax.servlet.ServletRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringbuildValueRegex(String value)StringgetEndpoint()StringgetHttpMethod()StringgetRequestURLPattern()protected StringpostCleanUri(String requestUri)protected StringpreCleanUri(javax.servlet.http.HttpServletRequest request)protected voidsetHttpMethod(String httpMethod)protected voidsetRequestURLPattern(javax.servlet.http.HttpServletRequest request, KeyCleanser cleanser)protected javax.servlet.http.HttpServletRequestsetupSpringVsFilterOrderingWorkaround(javax.servlet.http.HttpServletRequest request, KeyCleanser keyCleanser)voidupdateUserInformation(javax.servlet.http.HttpServletRequest request)If you plan to have user authentication in your web application, you should extendSpringWorkand overrideupdateUserInformation(HttpServletRequest)to add the user information to theMDC.-
Methods inherited from class com.deere.isg.worktracker.servlet.HttpWork
getAcceptHeader, getRemoteAddress, getRemoteUser, getService, getSessionId, setAcceptHeader, setRemoteAddress, setRemoteUser, setService, setSessionId
-
-
-
-
Field Detail
-
ENDPOINT
public static final String ENDPOINT
- See Also:
- Constant Field Values
-
-
Method Detail
-
updateUserInformation
public void updateUserInformation(javax.servlet.http.HttpServletRequest request)
If you plan to have user authentication in your web application, you should extendSpringWorkand overrideupdateUserInformation(HttpServletRequest)to add the user information to theMDC. Make sure to useHttpWork.setRemoteUser(String)to updateHttpWork.REMOTE_USERfor FloodSensor to be effective against `too many same user requests`.WARNING: Please do not provide any password!
- Parameters:
request- Can be useful if using JWT or header authentication
-
getRequestURLPattern
public String getRequestURLPattern()
-
setRequestURLPattern
protected void setRequestURLPattern(javax.servlet.http.HttpServletRequest request, KeyCleanser cleanser)
-
getEndpoint
public String getEndpoint()
-
getHttpMethod
public String getHttpMethod()
-
setHttpMethod
protected void setHttpMethod(String httpMethod)
-
preCleanUri
protected String preCleanUri(javax.servlet.http.HttpServletRequest request)
-
setupSpringVsFilterOrderingWorkaround
protected javax.servlet.http.HttpServletRequest setupSpringVsFilterOrderingWorkaround(javax.servlet.http.HttpServletRequest request, KeyCleanser keyCleanser)
-
-