How we can use non-Singleton servlet or handler in Guice, for example I want to create new instance for every request and immediately destroy it or give it to garbage collector after processing the request.
I dont want to keep ii in memory as singleton or reuse for other future requests.
I think probably somehow by using bind() function,
RGDS
You want to use RequestScope.
I typically use provider methods with scopes, so you would have code that looks like
Be sure to install
ServletModuleand setup theGuiceFilteror else this won’t work!