gpt4 book ai didi

com.github.bordertech.wcomponents.WebUtilities.renderWithTransformToHTML()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 16:31:05 25 4
gpt4 key购买 nike

本文整理了Java中com.github.bordertech.wcomponents.WebUtilities.renderWithTransformToHTML()方法的一些代码示例,展示了WebUtilities.renderWithTransformToHTML()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebUtilities.renderWithTransformToHTML()方法的具体详情如下:
包路径:com.github.bordertech.wcomponents.WebUtilities
类名称:WebUtilities
方法名:renderWithTransformToHTML

WebUtilities.renderWithTransformToHTML介绍

[英]Renders and transforms the given WComponent to a HTML String outside of the context of a Servlet.
[中]在Servlet的上下文之外,将给定的WComponent呈现并转换为HTML字符串。

代码示例

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Override
  public void run() {
    setActiveContext(uicChain);
    for (int i = 0; i < NUM_REPETITIONS; i++) {
      // Paint with the interceptor chain
      WebUtilities.renderWithTransformToHTML(component1);
    }
  }
};

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

/**
 * Renders and transforms the given WComponent to a HTML String outside of the context of a Servlet.
 *
 * @param component the root WComponent to render
 * @return the rendered output as a String
 */
public static String renderWithTransformToHTML(final WComponent component) {
  return renderWithTransformToHTML(new MockRequest(), component, true);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test(expected = SystemException.class)
public void testRenderToHtmlWithPlainText() {
  String msg = "Test error message";
  WText text = new WText(msg);
  // Text will fail as it is not valid XML
  String output = WebUtilities.renderWithTransformToHTML(new MockRequest(), text, false);
  Assert.assertEquals("Invalid html output returned", msg, output);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testRenderToHtmlWithXML() {
  WText text = new WText(TransformXMLTestHelper.TEST_XML);
  text.setEncodeText(false);
  // Dont use PageShell as it wraps the XML with ui:root and test xslt does not pass the other tags
  String output = WebUtilities.renderWithTransformToHTML(new MockRequest(), text, false);
  Assert.assertEquals("Invalid html output with XML", TransformXMLTestHelper.EXPECTED, output);
}
@Test

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

UIContextHolder.pushContext(uic);
try {
  html = WebUtilities.renderWithTransformToHTML(errorPage);
} catch (Exception e) {
  LOG.warn("Could not transform error page.", e);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com