Problem solved!
I solved the problem and this way works for me:
I had to put each controller into its own package. To make Liferay aware of this I had to configure portlet.xml
in a way to give each portlet which is listed a dedicated context configuration. Thus, I copied the <myPortlet>-portlet.xml
,
renamed it properly to <myOtherPortlet>-portlet.xml
and put this name into the
contextConfigParam <init-param>
element in portlet.xml.
Within the context config files I had to modify the context:component-scan element as follows to exclude the other controller to be
disregarded for this controller. For example, in the context configuration XML file for my ListController I have to exclude the
ImportController this way:
<context:component-scan base-package="com.foo.bar" use-default-filters="true">
<context:exclude-filter type="assignable" expression="com.foo.bar.importer.portlet.ImportController"/>
</context:component-scan>
...and in the context configuration XML file for the ImportController I have to exclude the ListController accordingly.