Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
352 views
in Technique[技术] by (71.8m points)

Java/JPA/Sping - Spring don't send correct model properties names to the front/end. Some cache is happening between the back and the front

I've an issue with some kind of cache happening between the back/end and the front/end. Spring don't send correct model properties names to the front/end.

My model looks like :

public Content(
        int id, 
        Set<Permission> permission, 
        Set<Os> os, 
        Set<Langage> langages, 
        Set<Framework> frameworks, 
        Set<Library> libraries, 
        String content
        ) {
            super();
            this.id= id;
            this.permission = permission;
            this.os= os;
            this.langages= langages;
            this.frameworks= frameworks;
            this.libraries= libraries;
            this.content= content;
}

But when I do a Get on my browser :

@GetMapping(value = "/doc/content/")
public ResponseEntity<List<Content>> getDoc() {
    List<Content> content = contentDao.findAll();
    System.out.println(content);
    return ResponseEntity.ok(content);
}
  1. My object structure in front ain't right. The data is correct and comes from the db, but the properties names are all wrong.

    blabla: 5,
    contentblabla: "uilui;",
    framework: [{"id": 38, "name": "Java"}],
    langage: [],
    library: [{"id": 23, "name": "GSAP"}],
    osblabla: [{id: 24, name: "Windows"}],
    permiblabla: []
    
  2. My object structure in back/end is correct (I check it from "System.out.println(content);")

As I've been playing around, I can guess it's some kind of cache since previous names I gave to this model.

Now my issue is that I've no idea how to get rid of that cache and I'd like to be able to change my models properties names. I tried to clean the project, to change the path, clear the browser cache, etc

Does anyone knows what is the problem ?

The repo is here if you need more detail.

Thank you !


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...