Obtains a view URI of the given controller and view name
@param controller The name of the controller
@param viewName The name of the view
@return The view URI
548239
public String getViewURI(GroovyObject controller, String viewName) {
        return getViewURI(getLogicalControllerName(controller), viewName);
    }
968449
@Override
    public String getTemplateURI(String controllerName, String templateName, boolean includeExtension) {
        if (templateName.startsWith(SLASH_STR)) {
            return getAbsoluteTemplateURI(templateName, includeExtension);
        }
        else if(templateName.startsWith(RELATIVE_STRING)) {
            return getRelativeTemplateURIInternal(templateName, includeExtension);
        }

        FastStringWriter buf = new FastStringWriter();
        String pathToTemplate = BLANK;

        int lastSlash = templateName.lastIndexOf(SLASH);
        if (lastSlash > -1) {
            pathToTemplate = templateName.substring(0, lastSlash + 1);
            templateName = templateName.substring(lastSlash + 1);
        }
        if(controllerName != null) {
            buf.append(SLASH)
                    .append(controllerName);
        }
        buf.append(SLASH)
                .append(pathToTemplate)
                .append(UNDERSCORE)
                .append(templateName);

        if(includeExtension) {
            return buf.append(EXTENSION).toString();
        }
        else {
            return buf.toString();
        }
    }
1204268
public static Collection<Link> getViewLinks(View view, Page page) throws ServletException, IOException {
		return view.getLinks(
			getServletContext(),
			getRequest(),
			getResponse(),
			page
		);
	}
414855
@Nullable
    public Controller getController(int position) {
        String instanceId = visiblePageIds.get(position);
        if (instanceId != null) {
            return host.getRouter().getControllerWithInstanceId(instanceId);
        } else {
            return null;
        }
    }
330704
@Override
    public URI getURI() throws URIException {
        StringBuffer buffer = new StringBuffer();
        if (this.httphost != null) {
            buffer.append(this.httphost.getProtocol().getScheme());
            buffer.append("://");
            buffer.append(this.httphost.getHostName());
            int port = this.httphost.getPort();
            if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
                buffer.append(":");
                buffer.append(port);
            }
        }
        buffer.append(this.path);
        if (this.queryString != null) {
            buffer.append('?');
            buffer.append(this.queryString);
        }
        String charset = getParams().getUriCharset();
        return new URI(buffer.toString(), true, charset);
    }
1026662
def detect_view_name(self, environ: Dict[str, Any]) -> str:
        
        urlvars = environ.get('wsgiorg.routing_args', [(), {}])[1]
        return urlvars.get(self.action_var_name)
299731
public String getTemplateURI(String controllerName, String templateName) {
        return getTemplateURI(controllerName, templateName, true);
    }
99712
function queryController(requestUri) {
    try {
        if (requestUri === undefined)
            return null;
        //split path
        var segments = requestUri.pathname.split('/');
        //put an exception for root controller
        //maybe this is unnecessary exception but we need to search for root controller e.g. /index.html, /about.html
        if (segments.length === 2)
            return 'root';
        else
        //e.g /pages/about where segments are ['','pages','about']
        //and the controller of course is always the second segment.
            return segments[1];
    }
    catch (err) {
        throw err;
    }
}
391499
public function getView(string $name = '')
    {
        if (empty($name)) {
            $name = $this->getComponentsName();
        }

        $view = $this->MVCFactory($name, 'View');

        return $view;
    }
781320
public static String getResourceUri(Resource resource) {
        try {
            return resource.getURI().toString();
        } catch (FileNotFoundException e) {
            return resource.getDescription();
        } catch (IOException e) {
            throw new RuntimeException("Could not create URI for resource: " + resource, e);
        }
    }
1092710
public static String getHistoryResourceURI(String uri, ServletRequest req) {

        String histUri = uri;
        if (CmsHistoryResourceHandler.isHistoryRequest(req)) {
            String version = req.getParameter(CmsHistoryResourceHandler.PARAM_VERSION);
            histUri = CmsRequestUtil.appendParameter(uri, CmsHistoryResourceHandler.PARAM_VERSION, version);
        }
        return histUri;
    }
419184
@Nullable public <VS> VS getViewState(@NonNull String viewId) {
    PresenterHolder holder = presenterMap.get(viewId);
    return holder == null ? null : (VS) holder.viewState;
  }
60306
@Override
	public void putViewName(String url, String viewName) {
		viewNameMappingInfoStorage.put(url, viewName);
	}
476426
public static List<Route> collectRouteFromControllerAnnotations(Controller controller) {
        String prefix = getPath(controller);
        List<Route> routes = new ArrayList<>();
        Method[] methods = controller.getClass().getMethods();
        for (Method method : methods) {
            org.wisdom.api.annotations.Route annotation = method.getAnnotation(org.wisdom.api.annotations.Route.class);
            if (annotation != null) {
                String uri = annotation.uri();
                uri = getPrefixedUri(prefix, uri);
                final Route route = new RouteBuilder().route(annotation.method())
                        .on(uri)
                        .to(controller, method)
                        .accepting(annotation.accepts())
                        .producing(annotation.produces());
                routes.add(route);
            }
        }
        return routes;
    }
949712
@Override
    public String getType(Uri uri) {
        if (!controller.hasPreinitialized()) {
            throw new IllegalStateException("Controller has not been initialized.");
        }

        int patternCode = controller.getUriMatcher().match(uri);
        MatcherPattern pattern = controller.findMatcherPattern(patternCode);
        if (pattern == null) {
            throw new IllegalArgumentException("unknown uri : " + uri.toString());
        }
        return pattern.getMimeTypeVndString();
    }
174031
@SuppressWarnings("unchecked")
    public V getView() {
        V result = null;
        if (viewName != null) {
            result = (V) viewProvider.getView(viewName);
        }
        return result;
    }
396929
@Override
    public String getDeployedViewURI(String controllerName, String viewName) {
        TupleStringKey key = new TupleStringKey(controllerName, viewName);
        String uri = deployedViewURICache.get(key);
        if (uri == null) {
            uri = super.getDeployedViewURI(controllerName, viewName);
            String prevuri = deployedViewURICache.putIfAbsent(key, uri);
            if (prevuri != null) {
                return prevuri;
            }
        }
        return uri;
    }