Example usage for com.vaadin.shared ApplicationConstants UIDL_PATH

List of usage examples for com.vaadin.shared ApplicationConstants UIDL_PATH

Introduction

In this page you can find the example usage for com.vaadin.shared ApplicationConstants UIDL_PATH.

Prototype

String UIDL_PATH

To view the source code for com.vaadin.shared ApplicationConstants UIDL_PATH.

Click Source Link

Usage

From source file:com.haulmont.cuba.web.sys.CubaApplicationServlet.java

License:Apache License

protected void serviceAppRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    RequestContext.create(request, response);
    statisticsCounter.incWebRequestsCount();

    long startTs = System.currentTimeMillis();

    try {/*from ww w .  jav a 2s  . c om*/
        super.service(request, response);
    } finally {
        RequestContext.destroy();
    }

    if (hasPathPrefix(request, ApplicationConstants.UIDL_PATH + '/')) {
        long t = System.currentTimeMillis() - startTs;
        if (t > (webConfig.getLogLongRequestsThresholdSec() * 1000)) {
            log.warn(String.format("Too long request processing [%d ms]: ip=%s, url=%s", t,
                    request.getRemoteAddr(), request.getRequestURI()));
        }
    }
}

From source file:info.magnolia.ui.admincentral.AdmincentralVaadinServlet.java

License:Open Source License

/**
 * same as {@link com.vaadin.server.ServletPortletHelper#isUIDLRequest}.
 *//*from  www  .j  a va  2 s. c  o  m*/
private boolean isUidlRequest(HttpServletRequest request) {
    String prefix = ApplicationConstants.UIDL_PATH + '/';
    String pathInfo = request.getPathInfo();

    if (pathInfo == null) {
        return false;
    }

    if (!prefix.startsWith("/")) {
        prefix = '/' + prefix;
    }

    return pathInfo.startsWith(prefix);
}