Using SPEL to call a method in the same class passing a variable taken from the actual method

Viewed 636

I want to be able to call another method of my class by passing the value of a parameter of the calling method, so suppose:

public class MyClass{

   @MySpelAnnotation("#this.otherMethod()") //how to I pass "arg" as parameter?
   public void mainMethod(String arg){
        ...
   }

   public void otherMethod(String arg){

   }

How can I be able to take arg from the first method and pass it to the second one?

0 Answers
Related