最近在做一个基于ssh开发的项目,博主本想用struts2注入来进行加快开发,但是一直都注入不了。后来在网上看了一些资料以及一些struts2的doc才知道:
所建的action要建立在struts, struts2, action, actions包或者其子包中,以下是struts2的doc:
First the Convention plugin finds packages named struts, struts2, action or actions. Any packages that match those names are considered the root packages for the Convention plugin. Next, the plugin looks at all of the classes in those packages as well as sub-packages and determines if the classes implementcom.opensymphony.xwork2.Action or if their name ends with Action (i.e. FooAction).
这样就可以了: