struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Rest plugin doesn't find actions
Date Tue, 16 Sep 2008 15:33:08 GMT

pauli-

in resources/struts-plugin.xml
try disabling the controllerScanning e.g. 
also try to disable the bypass Action Scan e.g.

    <constant name="struts.configuration.classpath.disableActionScanning" value="false"
/>
    <constant name="struts.configuration.rest.disableControllerScanning" value="true" />

http://struts.apache.org/2.x/struts2-plugins/struts2-rest-plugin/apidocs/org/apache/struts2/rest/ControllerClasspathPackageProvider.html

do you still miss the action classes?
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender.
This transmission is of a confidential nature and Sender does not endorse distribution to
any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission. 


> Date: Tue, 16 Sep 2008 16:56:22 +0200
> From: savolainen.pauli@gmail.com
> To: user@struts.apache.org
> Subject: Rest plugin doesn't find actions
> 
> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message