java - Override the Query String using a Servlet Filter -


i have requirement need to decrypt query string. planning via servlet filter , extending httpservletrequestwrapper shown below.

@webfilter(filtername = "urldecryptionfilter", urlpatterns = {"/*"}) public class urldecryptionfilter implements filter {     static class filteredrequest extends httpservletrequestwrapper {         public filteredrequest(servletrequest request) {             super((httpservletrequest)request);         }          public string getquerystring() {             //here put logic transform existing string             return "quertstr=modified";         }     }      @override     public void init(filterconfig filterconfig) throws servletexception {     }      @override     public void dofilter(servletrequest request, servletresponse response, filterchain chain) throws ioexception, servletexception {         chain.dofilter(new filteredrequest(request), response);     }      @override     public void destroy() {      } } 

but doesn't seem working. appreciate if can point in right direction.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -