Hi,

Is it possible to programmatically create HTML blocks that include struts
tags and include them in a JSP?

Here's a simple example which fails to produce the text field defined by the
html:text tag:

------------
<%@ page language="java" errorPage="ErrorPage.jsp" contentType="text/html"
%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html>
    <head>
        <link type="text/css" href="css/style.css" rel="stylesheet" ></link>
    </head>

    <body>
<%
    try {
        StringBuffer sbuf = StringBuffer();
        sbuf.append("<TR>");
        sbuf.append("   <TD class=\"TABLE_FIELD_DESCRIPTION\">");
        sbuf.append("     Employee Name:&nbsp;");
        sbuf.append("     <html:text property=\"headerField11\" size=\"15\"
styleClass=\"FORM_FIELDS\" >");
        sbuf.append("     </html:text>");
        sbuf.append("   </TD>");
        sbuf.append("</TR>");
        String variableHeaderHTML = sbuf.toString();
%>
        <html:form action="/myAction">

          <table border="0" class="TABLE_PRIMARY">

            <%= variableHeaderHTML %>

          </table>

        </html:form>
<%
    }
    catch(Exception ex) {
        System.out.println("ERROR: " +ex.toString());
    }
%>
    </body>
</html>


---------------
Thanks,

--BobC


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to