Using data from one controller action to another without making database call

52 views Asked by At

I am using grails 2.4.4

I have below details.

projectController
def index(){

    def projectList = REST WEB SERVICE CALL TO GET LIST OF PROJECT FROM DB.
}

def search1(){  // AJAX CALL

    def projectList = REST WEB SERVICE CALL TO GET LIST OF PROJECT FROM DB.
    def resultList = SEARCHING PROJECTNAME FROM ABOVE projectList.
}

def search2(){ // AJAX CALL

    def resultList = SEARCH BY PROJECTNAME FROM EXISTING projectList WITHOUT MAKING CALL FROM DB.
}

I know controllers are stateless.

Even thought projectList remains constant i have to make call to DB?

Is there any way to search from existing projectList without Reloading it from DB.

I am looking for JSF View scope like functionality in grails.

Thanks.

0

There are 0 answers