Examples of RequestPath


Examples of net.paoding.rose.web.RequestPath

                        + request.getCharacterEncoding());
            }
        }

        //
        final RequestPath requestPath = inv.getRequestPath();

        // save before include
        if (requestPath.isIncludeRequest()) {
            saveAttributesBeforeInclude(inv);
            // 恢复include请求前的各种请求属性(包括Model对象)
            rose.addAfterCompletion(new AfterCompletion() {

                @Override
                public void afterCompletion(Invocation inv, Throwable ex) throws Exception {
                    restoreRequestAttributesAfterInclude(inv);
                }
            });
        }

        // 调用之前设置内置属性
        inv.addModel("invocation", inv);
        inv.addModel("ctxpath", requestPath.getCtxpath());

        // instruction是控制器action方法的返回结果或其对应的Instruction对象(也可能是拦截器、错误处理器返回的)
        Object instruction = rose.doNext();

        if (Thread.currentThread().isInterrupted()) {
            logger.info("stop to render: thread is interrupted");
        } else {
            // 写flash消息到Cookie (被include的请求不会有功能)
            if (!requestPath.isIncludeRequest()) {
                FlashImpl flash = (FlashImpl) inv.getFlash(false);
                if (flash != null) {
                    flash.writeNewMessages();
                }
            }
View Full Code Here

Examples of org.nutz.mvc.RequestPath

  }

  @Test
  public void testPointPath() throws Throwable {
    request.setPathInfo("/1.2/say.nutz");
    RequestPath path = Mvcs.getRequestPathObject(request);
    assertNotNull(path);
    assertEquals("/1.2/say", path.getPath());
    assertEquals("nutz", path.getSuffix());

    request.setPathInfo("/1.2/say");
    path = Mvcs.getRequestPathObject(request);
    assertNotNull(path);
    assertEquals("/1.2/say", path.getPath());

    request.setPathInfo("/1.2/say.po/");
    path = Mvcs.getRequestPathObject(request);
    assertNotNull(path);
    assertEquals("/1.2/say.po/", path.getPath());

    request.setPathInfo("/1.2/say.po/.nut");
    path = Mvcs.getRequestPathObject(request);
    assertNotNull(path);
    assertEquals("/1.2/say.po/", path.getPath());
  }
View Full Code Here

Examples of org.nutz.mvc.RequestPath

    }

    @Test
    public void testPointPath() throws Throwable {
        request.setPathInfo("/1.2/say.nutz");
        RequestPath path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say", path.getPath());
        assertEquals("nutz", path.getSuffix());

        request.setPathInfo("/1.2/say");
        path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say", path.getPath());

        request.setPathInfo("/1.2/say.po/");
        path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say.po/", path.getPath());

        request.setPathInfo("/1.2/say.po/.nut");
        path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say.po/", path.getPath());
    }
View Full Code Here

Examples of org.nutz.mvc.RequestPath

    }

    @Test
    public void testPointPath() throws Throwable {
        request.setPathInfo("/1.2/say.nutz");
        RequestPath path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say", path.getPath());
        assertEquals("nutz", path.getSuffix());

        request.setPathInfo("/1.2/say");
        path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say", path.getPath());

        request.setPathInfo("/1.2/say.po/");
        path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say.po/", path.getPath());

        request.setPathInfo("/1.2/say.po/.nut");
        path = Mvcs.getRequestPathObject(request);
        assertNotNull(path);
        assertEquals("/1.2/say.po/", path.getPath());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.