dimanche 2 août 2015

static values are not working properly in grails controller with AWS server

I am using static variables inside controller, like :

static Date orderDate = new Date()
static String periodOfDay = "Lunch"
static List<Items> itemList
static String status = "PENDING"

And I am using these static variable in different-2 actions of this controller like :

def findData() {
           itemList = Items.findAllByDateAndStatusAndPeriodOfDay(orderDate, status, periodOfDay)
           println("-------itemList-------"+itemList)
            respond itemList 
         }

And I am calling this action via API call, I have set the URL mapping like this:

"/api/allListItems"(controller: "itemController", action: "findData")

When I am going to hit this url then its working fine in local host but its not working in AWS web server. (when I am going to run this url in local system then the println prints all the list of items, but in AWS its print [] blank list, there are values in my database)

I don't no whats going wrong. If any think m doing wrong or there is any better way to use these static variables then please help me. Thank you




Aucun commentaire:

Enregistrer un commentaire