I've used @Context
to access the HttpServletRequest
in the past, and it's worked.
I've got another class where I've tried to use this, but it's not being assigned, (ie request
is null
)
@ContextHttpServletRequest request;
All I'm trying to do is get the request parameters in a class, without having to pass them through to each parent instance.
So how can I get request.getParameter("username")
when request
is assigning as null?