|
|
How to forward to New View page
class=quot;org..web.servlet.view.Intern alResourceViewResolverquot;gt;
lt;property name=quot;prefixquot;gt;
lt;valuegt;/dialogs/lt;/valuegt;
lt;/propertygt;
lt;property name=quot;suffixquot;gt;
lt;valuegt;.jsplt;/valuegt;
lt;/propertygt;
lt;/beangt;[/COLOR][/I][/B]
Probably not the right forum for this post, but i will respond anyway.
Your problem really lies in the fact at how the org..web.servlet.view.InternalResou rceViewResolver works, and an actual clue to your problem is in the javadoc of this class itself.
To quote the javadoc
When chaining ViewResolvers, a InternalResourceViewResolver* always needs to be last, as it will attempt to resolve any view name,* no matter whether the underlying resource actually exists.
As you can see, this is your problem. There are a number of ways to get around this problem, but they vary wildly.
My issue is some times i need to forward from Controller to dialogs folder and some times need to forward to dialogs/include folder.
Is their any way i can declare in configuration file itself to look in to places using two view resolversAs Trevor said in his post that there are a number of ways to to get around this problem and which may vary wildly, I agree to that
One solution, apart from chaining the view resolvers, which I find the best to get around this is using the ResourceBundleViewResolver. Here you can specify the path to your jsp files in the properties file.
Specify the file path in the properties file like:Code:
your_jsp1.ucl=/WEB-INF/main_folder/sub_folder/your_jsp1.jsp
.....
your_jsp2.ucl=/WEB-INF/main_folder/another_sub_folder/your_jsp2.jsp
Cheers,
DeepakEdward
I use a DelegatingInternalResourceViewResolver.
I only used this approach so that when you have quot;set rulesquot; determining the viewResolver to use, you don't have to put another entry in a property file.
But once again, varies wildly on what you are trying to do, my solution only works if you have concrete rules to determine which view resolver to delegate to. |
|