Should all action classes be listed in struts.xml? Can the struts2 framework be aware of action classes if they are not listed in struts.xml?
Background: I am relatively new to struts and have been asked to cleanup some struts2 code. There are some classes that are not referred in struts2.xml, any jsp or javascript (I did a string search). I was wondering if I could remove these.
EDIT: I am pretty sure these classes are not used by other Java classes/libraries. It is the struts part I was wondering about.
In order to be used in their intended form as a web action, one of the following four possibilities must be true:
If the class you are looking at is not in struts.xml, is not annotated, is not referenced anywhere else in the project, and the project has not included the convention plugin, you should be good to go.
The only other gotcha would be to look for other *.xml files. struts.xml is capable of including other xml files into it, so that the actual action configuration for this class may reside in a different xml file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With