How set base package to scan subpackages for actions?

ぃ、小莉子 提交于 2019-12-06 03:33:05

Try

<constant name="struts.convention.action.packages" value="fi.fpf.mvc.*"/>

if you are using convention plugin, then you should follow the class and package name conventions. Why not just name a base package to "struts" or "struts2" and with the default package locators it will be located. Also the classes should have names that matches "Action" suffix.

You can tell the Convention plugin to ignore certain packages using the property struts.convention.exclude.packages. You can also tell the plugin to use different strings to locate root packages using the property struts.convention.package.locators. Finally, you can tell the plugin to search specific root packages using the property struts.convention.action.packages.

See the docs.

Alternatively, you could set the base package and locator that match this package and any package under the base

<constant name="struts.convention.package.locators.basePackage" value="fi.fpf.mvc"/>
<constant name="struts.convention.package.locators" value="fi,fpf,mvc"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!