how to return value from groovy to java

后端 未结 1 1954
一整个雨季
一整个雨季 2021-01-21 09:53

I have a jsp page tied to a servlet that runs groovy scripts. I am able to get to the groovy script from the servlet. But after the script runs how do I return the response from

相关标签:
1条回答
  • 2021-01-21 10:19

    Have the runTest groovy method return the value you want to pass to the servlet, and capture it as the return value of groovyObject.invokeMethod :

    Object ret = groovyObject.invokeMethod("runTest", args1);
    System.out.println("In Java " + ret);
    
    0 讨论(0)
提交回复
热议问题