private HttpServletResponse getHttpServletResponseUrlEncoder ( final Response response ) { return new HttpServletResponse ( ) { public void setLocale ( Locale loc ) { } public void setContentType ( String type ) { } public void setContentLength ( int len ) { } public void setBufferSize ( int size ) { } public void resetBuffer ( ) { } public void reset ( ) { } public boolean isCommitted ( ) { return false ; } public PrintWriter getWriter ( ) throws IOException { return new PrintWriter ( new RedirectWriter ( getResponse ( ) ) ) ; } public ServletOutputStream getOutputStream ( ) throws IOException { return null ; } public Locale getLocale ( ) { return null ; } public int getBufferSize ( ) { return 0 ; } public void flushBuffer ( ) throws IOException { } public void setStatus ( int sc , String sm ) { } public void setStatus ( int sc ) { } public void setIntHeader ( String name , int value ) { } public void setHeader ( String name , String value ) { } public void setDateHeader ( String name , long date ) { } public void sendRedirect ( String location ) throws IOException { } public void sendError ( int sc , String msg ) throws IOException { } public void sendError ( int sc ) throws IOException { } public String encodeUrl ( String url ) { return response . encodeURL ( url ) . toString ( ) ; } public String encodeURL ( String url ) { return response . encodeURL ( url ) . toString ( ) ; } public String encodeRedirectUrl ( String url ) { return null ; } public String encodeRedirectURL ( String url ) { return null ; } public boolean containsHeader ( String name ) { return false ; } public void addIntHeader ( String name , int value ) { } public void addHeader ( String name , String value ) { } public void addDateHeader ( String name , long date ) { } public void addCookie ( Cookie cookie ) { } public String getContentType ( ) { return null ; } public void setCharacterEncoding ( String charset ) { } @ Override public String getCharacterEncoding ( ) { return "UTF-8" ; } } ; }
Returns the HttpServletResponse which will be used to encode the URL