I need to acess the UriInfo from my HttpServlet, but whenever I try to inject it, the object is null.
Is there a way to access it from a HttpServlet? Am I missing something?
import javax.servlet.http.HttpServlet;@Slf4j@Configurationpublic class CustomServlet extends HttpServlet { @Autowired private OpenApiConfig openApiConfig; @Autowired SwaggerModelConfig swaggerModelConfig; @Context UriInfo uriInfo; @Override public void init(ServletConfig config) throws ServletException { super.init(config); SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext()); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // need to access UriInfo here }}