I am having trouble with the following problem: there is a need to put two web apps (that are implemented using spring portlet mvc) into a single app. Each of the apps has a similar directory structure, and some of the files (jsp's and portlet descriptors) have the same names, thus making it impossible to put apps' contents into the same folders.
But now, if I put jsp's into separate folders, then (if my understanding is correct) I need either a separate view resolver for each of them, or prepend all references to view names with the folder names where those jsp's are moved to. The latter solution means there must be thousands of changes within java code and descriptors (the applications include quite a number of portlets), and lots of testing, which is really not acceptable.
I looked at the spring documentation and it says that it's possible to define several view resolver beans in the application context, and then when determining the full view name each of them is checked until one returns a view (order of checking can be different, etc.).
What I don't know is whether it is possible to use the same view resolver (i. e. the same implementation). I tried to do like this:
for one folder of jsp's, and
for another one.
The result is that views for the first folder, /WEB-INF/jsp/wap/, are being resolved, but for the second one I get blank pages (without any errors in the app server logs). Spring documentation says, that some resolvers, like InternalResourceViewResolver, return a non-null view in any case, so, it is very probable that the actual views are not being resolved with no errors.
Maybe someone knows if I'm using the right approach and if it is correct to use the same view resolver implementation (InternalResourceViewResolver in my case)? Or is there another, a better solution to the problem? Or maybe multiple view resolver definitions need some additional properties to be set?
I managed to solve the problem by configuring a separate InternalResourceViewResolver for each portlet within each of their application context files and giving them a high priority order. This approach works but it required changes within a lot of xml files and people extending applications need to be aware of the need to provide a view resolver bean for their new portlets. Maybe someone knows a better approach?