public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
MethodParameter methodParameter = ((HandlerMethod) handler).getMethodParameters()[0];
for (Field field : ((Class) methodParameter.getGenericParameterType()).getDeclaredFields()) {
field.setAccessible(true);
field.set(?, anEntity);
}
return true;
}
How can i set a entity field in Interceptor?
Aucun commentaire:
Enregistrer un commentaire