servlets - Null Pointer Exception on using HTTPServletRequest.authenticate in Tomcat 7 -


i have servlet based rest api. have conditionally turn on/off authentication based on path parameters. have rules stored in db. found servlet3.0 provides httpservletrequest.authenticate(), can used programmtically launch login. so, added following in web.xml

<login-config>  <auth-method>basic</auth-method> </login-config>  

and in servletfilter, have code launch login programmatically

request.authenticate(response); 

but null pointer exception

java.lang.nullpointerexception org.apache.catalina.connector.request.authenticate(request.java:2603) org.apache.catalina.connector.requestfacade.authenticate(requestfacade.java:1059) 

am missing configuration? appreciate help.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -