I created a new class called RegesterAction
but I didn\'t keep this class in any package. How can I configure this class in the struts.xml
?
The package name is completely independent of your code artifacts.
The struts-default package is... the Struts 2 default package. It defines default result types, interceptors, interceptor stacks, and a few other defaults.. You do not need to extend it, but if you don't, you have a fair amount of manual work to do in your own package.
I believe you should put your action classes in a package, and can think of no reasonable argument against the best practice of doing so. Again, your action class packages are completely independent of package names, or what (if any) the package extends.