Announcement Announcement Module
Collapse
No announcement yet.
how to check if a tiles 2 view name is valid in view resolver Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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

    Comment

    Working...
    X