0
HttpServletRequest getServletContext() method not found
HttpServletRequest getServletContext() method is not found even in servlet3
10 Respuestas
+ 2
Write here the error message too. Without that is is hard to help.
+ 1
req.getSession().getServletContext()
+ 1
Check the servlet API. This method requires a String parameter, do you pass one?
+ 1
Check the API. The parameterless version has an "s" in the end of the name: getServletRegistrations. There is no other method.
http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getServletRegistration(java.lang.String)
+ 1
You won't be able to finish a project if you don't think or you don't try to find out what the problem is. Your last post is the same as your first. You call the getServletContext() of HttpServletRequest which doesn't exists. My first post was: req.getSession().getServletContext().
0
thanks for responding.. now I am getting not found error for getServletRegistration().
0
nope. both methods are there .. with and without parameters.. i tried with parameters also 😣
0
oops.. that's my mistake.. i just missed.. it is registrations ()
0
Map<String, ? extends servletRegistration> sr = reg.getServletContext().getServletRegistrations();
i am getting cannot resolve method getServletContext() error
0
yah. i tried with getSession() then it is showing same error in getServletRegistrations ()