java - Break servlet-filter work -


i have securityauthorisationfilter , following part of code:

for(string anonymousrequesturi : anonymousrequesturis) {      if(httprequest.getrequesturi().equals(anonymousrequesturi)) {          //allow request      }  }  string authtoken = gettokenfromrequest(httprequest); 

if equals true need skip next filter operations , send request controller. but, if write filterchain.dofilter(servletrequest, servletresponse), there no result. filter continue operations find token. how can break out of filter?

as understand comment, wish "break out" of current filter if condition anonymous request uri true. return; after calling chain.dofilter():

for ( string uri : anonuris ) {     if ( ... ) {         chain.dofilter( ... );         return;     } }  string authtoken = gettokenfromrequest( httprequest ); ... 

cheers,


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -