Hello,

I was using struts 2.1.1.-SNAPSHOT (tile, codebehind and rest plugins)
and everything was working find. Changing to 2.1.2 makes makes my
actions not being found anymore.

A class org.apache.struts2.rest.ControllerClasspathPackageProvider in
the rest plugin is used to determine which classes are actions in the
packages given in the web.xml. When I debug the control ends up in
here in ControllerClasspathPackageProvider class:

@Override
protected ClassTest createActionClassTest() {
  return new ClassTest() {
    // Match Action implementations and classes ending with "Controller"
    public boolean matches(Class type) {
      return (type.getSimpleName().endsWith("Controller"));
    }
  };
}

This tests if the class name ends in "Controller" and obviously my
action classes don't do that, so no actions are found. (It also should
test whether the class is of type Action according to the comment). So
when no actions are found, a codebehind plugins
org.apache.struts2.codebehind.CodebehindUnknownHandler is used to
determine the action but it fails to find any actions.

Is the error in the ControllerClasspathPackageProvider which should be
more flexible, is it the CodebehindUnknownHandler or is it my
integration of tiles, rest and codebehind that fails? I was under an
impression that when I define my action packages in the web.xml
codebehind/rest automatically will treat every class with certain
conditions in those packages as actions. From struts 2 documentation:

"Set the "actionPackages" filter init param to a comma-separated list
of packages containing Action classes in web.xml. The packages and
their subpackages will be scanned. All classes in the designated
packages that implement Action or end in "Action" are examined. The
latter is to allow for POJO Actions that don't implement the Action
interface."

And I am doing exactly this. I am just wondering what was changed from
2.1.1 to 2.1.2 to make my actions not being found anymore. Thank you.

Pauli

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to