Created
July 13, 2015 20:07
-
-
Save lefloh/e6bf1d9393120e471980 to your computer and use it in GitHub Desktop.
RESTesy ContainerRequestFilter overwriting the DefaultEncoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Provider | |
public class CharsetFilter implements ContainerRequestFilter { | |
@Override | |
public void filter(ContainerRequestContext requestContext) throws IOException { | |
String charset = requestContext.getHeaderString("X-Charset"); | |
if (charset != null) { | |
requestContext.setProperty(InputPart.DEFAULT_CHARSET_PROPERTY, charset); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment