What drop wizard version are you using ?, It is not working for me with
0.9.3
On Friday, January 29, 2016 at 11:06:44 AM UTC-5, Vaibhav Dhawan wrote:
>
> I was able to get through this. Jersey entity filter dependency was
> missing from my pom and i though dw core would have it covered.
>
> Still surprised why wont it throw a compilation error.
>
> On Friday, 29 January 2016 13:48:14 UTC+5:30, Vaibhav Dhawan wrote:
>>
>> Hello,
>>
>> I am trying to configure EntityFilteringFeature in my DW application but
>> it doesnt seem to filter out fields. here is what i have done
>>
>> *Entity is listed as *
>>
>> public class Cities {
>>
>> private int cityId;
>> private String cityName;
>> @ProjectDetailedView
>> private int cityStatus;
>>
>> //.. setters and getters
>>
>> *ProjectDetailedView is listed as *
>>
>> @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
>> @Retention(RetentionPolicy.RUNTIME)
>> @Documented
>> @EntityFiltering
>> public @interface ProjectDetailedView {
>>
>> public static class Factory extends
>> AnnotationLiteral<ProjectDetailedView> implements ProjectDetailedView {
>> private Factory() {
>> }
>> public static ProjectDetailedView get() {
>> return new Factory();
>> }}}
>>
>> *Added following lines in app *
>>
>> environment.jersey().register(EntityFilteringFeature.class);
>> environment.jersey().register(JacksonFeatures.class); //Probably not
>> needed
>>
>> *Resource is listed as following. *
>>
>> GET
>> @UnitOfWork
>> @Produces(MediaType.APPLICATION_JSON)
>> //@ProjectDetailedView
>> public List<Cities> getCities() {
>> return citiesDAO.findAll();
>> }
>>
>> I am expecting limited response when the annotation is commented out.
>> However i get the full response in both the cases.
>>
>> Am i missing anything. Any pointers are much appreciated.
>>
>> Thanks
>> Vaibhav
>>
>
--
You received this message because you are subscribed to the Google Groups
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.