As Ted wrote those methods should return Strings which will determine the
result to be shown.

String myCustomMethod() {
  if(1)
    return "result1";
  else return "result2";
}

<action name="sample" method="myCustomMethod">
  <result name="result1">/pages/course1.jsp</result>
  <result name="result2">/pages/course2.jsp</result>
</action>

Also I do not recommend to define action name like

<action name="course!*"

since '!' is already a special character which specifies the method name
automatically
see struts.properties configuration file for more details about how to
enable/disable dynamic method invocation

struts.enable.DynamicMethodInvocation=false/true

but you can use wildcards in some other way like "course/*".

Note: using in result definition

<result type="redirect-action">course!list</result>

"course!list" will call action course and the method "list" will be invoked.

Best,
Aram

Reply via email to