-
Jul 25th, 2008, 05:11 AM
#1
how to check if a tiles 2 view name is valid in view resolver
Hi
I created an new view resolver extends UrlBasedViewResolver. How do I check if a view definition name is valid, or is defined in Tiles 2 configuration?
I tried to use method TilesContainer.isValidName, but have problem to find RequestObjects that is required.
Any help or hint is appreciated. thanks in advance.
Fred
-
Jul 28th, 2008, 11:29 PM
#2
attached method that requires validation
the attached is the method that I need figure out if a tiles 2 definition is valid. This method is
in my class extends UrlBasedViewResolver
protected View loadView(String viewName, Locale locale) throws Exception {
ServletContext servletContext = getServletContext();
TilesContainer container = TilesAccess.getContainer(servletContext);
Object[] requestObjects = {?.getRequest(), ?.getResponse()};
if (container.isValidDefinition(viewName, requestObjects)) {
return super.loadView(viewName, locale);
}
else {
return null;
}
}
can someone tell me how to get request and response object within this method? Or is there any other way to figure out a valid tiles 2 definition in this method?
Any help is greatly appreciated.
Fred
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules