Package org.htmlparser.tags

Examples of org.htmlparser.tags.JspTag.toHtml()


        assertTrue("Node 1 should be an HTMLJspTag", node[0] instanceof JspTag);
        JspTag tag = (JspTag) node[0];
        assertEquals(
            "Raw String of the first JSP tag",
            "<%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %>",
            tag.toHtml());

        // The third node should be an HTMLJspTag
        assertTrue("Node 2 should be an HTMLJspTag", node[2] instanceof JspTag);
        JspTag tag2 = (JspTag) node[2];
        String expected =
View Full Code Here


                + "        if(transfer.validate(request))\r\n"
                + "            %>";
        assertEquals(
            "Raw String of the second JSP tag",
            expected,
            tag2.toHtml());
        assertTrue("Node 4 should be an HTMLJspTag", node[4] instanceof JspTag);
        JspTag tag4 = (JspTag) node[4];
        expected = "<%\r\n" + "%>";
        assertEquals(
            "Raw String of the fourth JSP tag",
View Full Code Here

        JspTag tag4 = (JspTag) node[4];
        expected = "<%\r\n" + "%>";
        assertEquals(
            "Raw String of the fourth JSP tag",
            expected,
            tag4.toHtml());

    }
    public void testSpecialCharacters() throws ParserException
    {
        StringBuffer sb1 = new StringBuffer();
View Full Code Here

        //assertTrue("Node should be a jsp tag",node[1] instanceof HTMLJspTag);
        JspTag jspTag = (JspTag) node[0];
        assertEquals(
            "jsp toHTML()",
            "<% for (i=0;i<j;i++);%>",
            jspTag.toHtml());
    }
}
View Full Code Here

        parser.setNodeFactory (new PrototypicalNodeFactory (new JspTag ()));
        parseAndAssertNodeCount(8);
        // The first node should be a JspTag
        assertTrue("Node 1 should be a JspTag",node[0] instanceof JspTag);
        JspTag tag = (JspTag)node[0];
        assertEquals("Raw String of the first JSP tag","<%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %>",tag.toHtml());


        // The fifth node should be a JspTag
        assertTrue("Node 5 should be a JspTag",node[4] instanceof JspTag);
        JspTag tag2 = (JspTag)node[4];
View Full Code Here

        // The fifth node should be a JspTag
        assertTrue("Node 5 should be a JspTag",node[4] instanceof JspTag);
        JspTag tag2 = (JspTag)node[4];
        String expected = "<%" + guts + "%>";
        assertEquals("Raw String of the second JSP tag",expected,tag2.toHtml());
        assertTrue("Node 7 should be a JspTag",node[6] instanceof JspTag);
        JspTag tag4 = (JspTag)node[6];
        expected = "<%\n%>";
        assertEquals("Raw String of the fourth JSP tag",expected,tag4.toHtml());
    }
View Full Code Here

        String expected = "<%" + guts + "%>";
        assertEquals("Raw String of the second JSP tag",expected,tag2.toHtml());
        assertTrue("Node 7 should be a JspTag",node[6] instanceof JspTag);
        JspTag tag4 = (JspTag)node[6];
        expected = "<%\n%>";
        assertEquals("Raw String of the fourth JSP tag",expected,tag4.toHtml());
    }

    public void testSpecialCharacters() throws ParserException {
        StringBuffer sb1 = new StringBuffer();
        sb1.append("<% for (i=0;i<j;i++);%>");
View Full Code Here

        createParser(sb1.toString());
        parser.setNodeFactory (new PrototypicalNodeFactory (new JspTag ()));
        parseAndAssertNodeCount(1);
        //assertTrue("Node should be a jsp tag",node[1] instanceof HTMLJspTag);
        JspTag jspTag = (JspTag)node[0];
        assertEquals("jsp toHTML()","<% for (i=0;i<j;i++);%>",jspTag.toHtml());
    }


    /**
     * See bug #772700 Jsp Tags are not parsed correctly when in quoted attributes.
View Full Code Here

    parseAndAssertNodeCount(5);
    // The first node should be an HTMLJspTag
    assertTrue("Node 1 should be an HTMLJspTag", node[0] instanceof JspTag);
    JspTag tag = (JspTag) node[0];
    assertEquals("Raw String of the first JSP tag", "<%@ taglib uri=\"/WEB-INF/struts.tld\" prefix=\"struts\" %>",
        tag.toHtml());

    // The third node should be an HTMLJspTag
    assertTrue("Node 2 should be an HTMLJspTag", node[2] instanceof JspTag);
    JspTag tag2 = (JspTag) node[2];
    String expected = "<%\r\n" + "    org.apache.struts.util.BeanUtils.populate(transfer, request);\r\n"
View Full Code Here

        + "    if(request.getParameter(\"marker\") == null)\r\n"
        + "        // initialize a pseudo-property\r\n"
        + "        transfer.set(\"days\", java.util.Arrays.asList(\r\n"
        + "            new String[] {\"1\", \"2\", \"3\", \"4\", \"31\"}));\r\n" + "    else \r\n"
        + "        if(transfer.validate(request))\r\n" + "            %>";
    assertEquals("Raw String of the second JSP tag", expected, tag2.toHtml());
    assertTrue("Node 4 should be an HTMLJspTag", node[4] instanceof JspTag);
    JspTag tag4 = (JspTag) node[4];
    expected = "<%\r\n" + "%>";
    assertEquals("Raw String of the fourth JSP tag", expected, tag4.toHtml());
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.