當前位置: 首頁>>代碼示例>>Java>>正文


Java Html類代碼示例

本文整理匯總了Java中org.apache.ecs.html.Html的典型用法代碼示例。如果您正苦於以下問題:Java Html類的具體用法?Java Html怎麽用?Java Html使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Html類屬於org.apache.ecs.html包,在下文中一共展示了Html類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addHeader

import org.apache.ecs.html.Html; //導入依賴的package包/類
protected void addHeader(Html html) {
    //<head>
    //  <link rel="stylesheet" href="../../../../../resources/webapp/css/bootstrap.css" type="text/css" />
    // </head>
    String[] headerlinks = getContext().getHeaderlinks();
    if (headerlinks != null && headerlinks.length > 0) {
        String relativePath = constructRelativeLinkPath();
        Head head = new Head();
        for (String headerlink : headerlinks) {
            Link link = new Link();
            link.setRel("stylesheet");
            link.setType("text/css");
            link.setHref(relativePath + headerlink.trim());
            head.addElement(link);
        }
        html.addElement(head);
    }
}
 
開發者ID:Nocket,項目名稱:nocket,代碼行數:19,代碼來源:CreateHtmlVisitor.java

示例2: getSource

import org.apache.ecs.html.Html; //導入依賴的package包/類
public String getSource(WebSession s)
{
	String source = null;
	String src = null;

	try
	{
		// System.out.println("Loading source file: " +
		// getSourceFileName());
		src = convertMetacharsJavaCode(readFromFile(new BufferedReader(new FileReader(s
				.getWebResource(getSourceFileName()))), true));

		// TODO: For styled line numbers and better memory efficiency,
		// use a custom FilterReader
		// that performs the convertMetacharsJavaCode() transform plus
		// optionally adds a styled
		// line number. Wouldn't color syntax be great too?
	} catch (Exception e)
	{
		s.setMessage("Could not find source file");
		src = ("Could not find the source file or source file does not exist.<br/>"
				+ "Send this message to: <a href=\"mailto:" + s.getWebgoatContext().getFeedbackAddress()
				+ "?subject=Source " + getSourceFileName() + " not found. Lesson: "
				+ s.getCurrentLesson().getLessonName() + "\">" + s.getWebgoatContext().getFeedbackAddress() + "</a>");
	}

	Html html = new Html();

	Head head = new Head();
	head.addElement(new Title(getSourceFileName()));

	Body body = new Body();
	body.addElement(new StringElement(src));

	html.addElement(head);
	html.addElement(body);

	source = html.toString();

	return source;
}
 
開發者ID:RIGS-IT,項目名稱:sonar-xanitizer,代碼行數:42,代碼來源:AbstractLesson.java

示例3: createHtml

import org.apache.ecs.html.Html; //導入依賴的package包/類
public Html createHtml() {
    final Html html = new Html();
    html.addAttribute("xmlns:wicket", "http://wicket.apache.org");
    return html;
}
 
開發者ID:subes,項目名稱:invesdwin-nowicket,代碼行數:6,代碼來源:HtmlComponentBuilder.java

示例4: newHtml

import org.apache.ecs.html.Html; //導入依賴的package包/類
@Override
protected Html newHtml() {
    Html html = super.newHtml();
    addTablegrid();
    return html;
}
 
開發者ID:Nocket,項目名稱:nocket,代碼行數:7,代碼來源:HtmlGeneratorVisitorTablegrid.java


注:本文中的org.apache.ecs.html.Html類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。