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
145 views
in Technique[技术] by (71.8m points)

List of domain contents not rendering on one GSP but is on another Grails

Right so my codes for my test view is:

    @Secured(["IS_AUTHENTICATED_REMEMBERED", "IS_AUTHENTICATED_FULLY"])
    def list(){
        def allPosts = postService.getPosts()
    }
question from:https://stackoverflow.com/questions/65950281/list-of-domain-contents-not-rendering-on-one-gsp-but-is-on-another-grails

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

1 Answer

0 votes
by (71.8m points)

Try to return from the service in this way

@Transactional
class PostService {

    def getPosts() {
        Post.list()
    }
}

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

...