I have a Struts 2 JSP page with the following snippet:
which correctly prints out the value of
is a correct syntax, but to get the value of the method that have a signature
public String myMethod(String value){
return value;
}
required the getter for myVariable
public String getMyVariable() {
return myVariable;
}
if you set the value to myVariable
like
private String myVariable = "myValue";
then it should be printed in JSP. If the argument is other type it will be converted to String
and the method will call.