Is the any way in Jersey to make it treat empty strings in parameter
injection as null's ?
I tried something hacky like:
@Provider
public class StringStringReaderProvider
implements StringReaderProvider<String> {
@Override
public StringReader<String> getStringReader(
Class<?> type, Type genericType, Annotation[] annotations) {
return new StringReader<String>() {
@Override
public String fromString(String value) {
if(value == null) {
return null;
} else if(value.isEmpty()) {
return null;
} else {
return value;
}
}
};
}
}
but it didn't work :o)
--
Adam Walczak
www.adamwalczak.info
+48 604 188 992