calss GeneralModal<T extends BaseEntity>
{
private T entity
public void setEntity(T entity)
{
this.entity=entity;
}
public T getEntity()
{
return entity;
}
}

Now I have in my controller


@Override
@RequestMapping(value="", method=RequestMethod.POST)
@ResponseBody
public ModelAndView Filter(@ModelAttribute("entity") GeneralModal<RoleEntity> entity, BindingResult result, SessionStatus status) throws InstantiationException, IllegalAccessException
{
return super.Filter(entity, result, status);

}


Now before this method getting called it tries to fill
@ModelAttribute("entity") GeneralModal<RoleEntity> entity
where it gives error saying that
Can't instantiate
T entity