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
Post a Comment