Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 675

How to get ServletRequest in any class using @Context or similar?

$
0
0

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?


Viewing all articles
Browse latest Browse all 675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>