Package org.hdiv.dataComposer

Examples of org.hdiv.dataComposer.IDataComposer


    this.getConfig().setAvoidValidationInUrlsWithoutParams(Boolean.TRUE);

    HttpServletRequest request = HDIVUtil.getHttpServletRequest();

    IDataComposer dataComposer = this.dataComposerFactory.newInstance(request);
    HDIVUtil.setDataComposer(dataComposer, request);
    dataComposer.startPage();

    String action = "/testAction.do";

    String result = this.formUrlProcessor.processUrl(request, action);

    // Post urls are not modified
    assertEquals(action, result);

    String val = dataComposer.compose("param", "value", false);
    assertEquals("0", val);

    String requestId = dataComposer.endRequest();

    assertNotNull(requestId);
    assertTrue(requestId.length() > 0);
  }
View Full Code Here


    HttpServletRequest request = HDIVUtil.getHttpServletRequest();
    String url = "/testAction.do";
    String url2 = "/otherAction.do";

    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
    dataComposer.startScope("app");

    String result1 = this.linkUrlProcessor.processUrl(request, url);

    String result2 = this.linkUrlProcessor.processUrl(request, url2);
View Full Code Here

  public void testScopeSame() {

    HttpServletRequest request = HDIVUtil.getHttpServletRequest();
    String url = "/testAction.do";

    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
    dataComposer.startScope("app");

    String result1 = this.linkUrlProcessor.processUrl(request, url);

    String result2 = this.linkUrlProcessor.processUrl(request, url);
View Full Code Here

    HttpServletRequest request = HDIVUtil.getHttpServletRequest();
    String url = "/testAction.do?param=value";
    String url2 = "/testAction.do?other=value";

    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
    dataComposer.startScope("app");

    String result1 = this.linkUrlProcessor.processUrl(request, url);

    String result2 = this.linkUrlProcessor.processUrl(request, url2);
View Full Code Here

  public void testScopeSameParams() {

    HttpServletRequest request = HDIVUtil.getHttpServletRequest();
    String url = "/testAction.do?param=value";

    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
    dataComposer.startScope("app");

    String result1 = this.linkUrlProcessor.processUrl(request, url);

    String result2 = this.linkUrlProcessor.processUrl(request, url);
View Full Code Here

  public void testScopedPage() {

    MockHttpServletRequest request = (MockHttpServletRequest) HDIVUtil.getHttpServletRequest();
    // Put a uri that is configured as a scoped page
    request.setRequestURI("/scopedPage/user.html");
    IDataComposer dataComposer = this.dataComposerFactory.newInstance(request);
    HDIVUtil.setDataComposer(dataComposer, request);
    assertTrue(dataComposer instanceof DataComposerMemory);

    dataComposer.startPage();
    dataComposer.beginRequest("POST", "test.do");
    dataComposer.compose("test.do", "parameter1", "2", false);
    dataComposer.compose("test.do", "parameter1", "2", false);
    String stateId = dataComposer.endRequest();

    assertTrue(stateId.startsWith("U-"));

    StateScope scope = this.stateScopeManager.getStateScope(stateId);
    assertEquals("user-session", scope.getScopeName());
View Full Code Here

    // Don`t create IDataComposer if it is not necessary
    boolean exclude = this.hdivConfig.hasExtensionToExclude(request.getRequestURI());
    if (!exclude) {

      // Init datacomposer
      IDataComposer dataComposer = this.dataComposerFactory.newInstance(request);

      HDIVUtil.setDataComposer(dataComposer, request);
    }

  }
View Full Code Here

  public void endPage(HttpServletRequest request) {

    // End page in datacomposer
    boolean exist = HDIVUtil.isDataComposer(request);
    if (exist) {
      IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
      dataComposer.endPage();

      HDIVUtil.removeDataComposer(request);
    }

  }
View Full Code Here

   * @see org.hdiv.dataComposer.IDataComposer#composeFormField(String, String, boolean, String)
   */
  public int doStartTag() throws JspException {

    HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);

    // this property is editable and we must check it
    if (property != null) {
      dataComposer.composeFormField(prepareName(), "", true, null);
    }

    return super.doStartTag();
  }   
View Full Code Here

    // Init Request scoped data
    RequestInitializer requestInitializer = this.applicationContext.getBean(RequestInitializer.class);
    requestInitializer.initRequest(request, response);
    DataComposerFactory dataComposerFactory = (DataComposerFactory) this.applicationContext
        .getBean(DataComposerFactory.class);
    IDataComposer dataComposer = dataComposerFactory.newInstance(request);
    HDIVUtil.setDataComposer(dataComposer, request);

    if (log.isDebugEnabled()) {
      log.debug("Hdiv test context initialized");
    }
View Full Code Here

TOP

Related Classes of org.hdiv.dataComposer.IDataComposer

Copyright © 2018 www.massapicom. 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.