ich ein Objekt mit Format JSON impfen will, die ein Attribut mit dem Typ Enum haben , wenn ich meine Anfrage lanch ich Fehler fet 403Web-Service-Erholung mit Angular2 und Feder mit Enum-Typ
das ist mein Dienst in Vorderseite
export enum DocumentComponentType {
DIV_12,
DIV_4_4_4,
DIV_4_8,
DIV_8_4,
DIV_6_6,
}
export interface DocumentComponent {
id: number;
type: DocumentComponentType;
// documentContents: DocumentContent[];
}
this.gridService.addDocumentComponent({id: 0, type: DocumentComponentType.DIV_8_4}, 6)
.subscribe(data => {
this.documentComponent = data;
},
error => alert('Erreur ' + error),
() => {
console.log("finished ");
}
);
und in Server-Seite
das ist meine Klasse
public class DocumentComponent {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
DocumentComponentType type;
@OneToMany(mappedBy = "documentComponent")
private List<DocumentContent> documentContents;
@ManyToOne
Document document;
DocumentComponent(){
}
}
und meine Enum
public enum DocumentComponentType {
DIV_12,
DIV_4_4_4,
DIV_4_8,
DIV_8_4,
DIV_6_6,
}
ich Fehler 500 (Internal Server Error)
Sucht in der Server-Protokolldatei. Dort sollten Sie die Grundursache der Ausnahme sehen – Jens
das ist mein Fehler in Server NULL verletzt die NOT NULL Einschränkung für die Spalte "ID" ABER ich habe generatedValue –