Skip to content

Instantly share code, notes, and snippets.

@circlee
Created June 30, 2020 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save circlee/695514f0c30cbeb5dc4c5693be5b7bae to your computer and use it in GitHub Desktop.
Save circlee/695514f0c30cbeb5dc4c5693be5b7bae to your computer and use it in GitHub Desktop.
/**
* Factory that exposes the current request object on demand.
*/
@SuppressWarnings("serial")
private static class RequestObjectFactory implements ObjectFactory<ServletRequest>, Serializable {
@Override
public ServletRequest getObject() {
return currentRequestAttributes().getRequest();
}
@Override
public String toString() {
return "Current HttpServletRequest";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment