开发者

Grails session cannot assign java.string

开发者 https://www.devze.com 2023-04-03 22:11 出处:网络
I\'m getting this error Error 500: Executing action [pay] of controller [org.gamestrike.PaymentController] caused exception: groovy.lang.MissingMethodException: No signature of method开发者_JAVA技巧:

I'm getting this error

Error 500: Executing action [pay] of controller [org.gamestrike.PaymentController] caused exception: groovy.lang.MissingMethodException: No signature of method开发者_JAVA技巧: org.gamestrike.PaymentController.session() is applicable for argument types: (java.lang.String) values: [2011-09-15] Possible solutions: getSession() Servlet: grails URI: /GameStrike/grails/payment/pay.dispatch Exception Message: No signature of method: org.gamestrike.PaymentController.session() is applicable for argument types: (java.lang.String) values: [2011-09-15] Possible solutions: getSession() Caused by: No signature of method: org.gamestrike.PaymentController.session() is applicable for argument types: (java.lang.String) values: [2011-09-15] Possible solutions: getSession() Class: PaymentController At Line: [35] Code Snippet:


Without your code it's hard to tell, but it looks like you're treating session like a method, but it's not. It's an object - the HttpSession instance.

You can call the standard methods on it, e.g. getAttribute and setAttribute but Grails adds convenience behavior. It acts like a Map so to set or get attributes you can do this:

def foo = session.foo // session.getAttribute('foo')
session.bar = 123 // session..setAttribute('bar', 123)
0

精彩评论

暂无评论...
验证码 换一张
取 消