When is the Struts Convention Plug-in Applied?

75 views Asked by At

I’m trying to understand how the Convention plugin determines when to do URL interpretation. In some REST Plug-in examples I see PrefixBasedActionMapper configured with ”/rest:rest,:struts” and it seems that Convention is only applied to the rest mapper and not the DefaultActionMapper. Is this correct? Either way, under what conditions does the Convention plugin kick in for requests?

I’ve been googling like a mad-man these last two days and can’t seem to find any explanation. Inspecting the plugin source didn't give any insights either.

1

There are 1 answers

0
Yasser Zamani On

They are different. Convention Plugin is not about URL/action mapping. It just search java classes and create action configs from them.

However, you can tell the plugin to search specific root packages using the property struts.convention.action.packages. e.g.

<constant name="struts.convention.action.packages" value="com.mycompany.myactions.myconvention.*"/>