Hi, I try to use sb.append in my jsp page, but it is not successful. There is no error message, but when I open the browser, it only show:

Not a member yet? Register here. It is FREE.
:

Please help... thanks!!

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html>
<head>
</head>
<body>
<font size="+1" color="#55BBEA">Not a member yet? Register here. It is FREE. </font><br>
<html:form action="/register">

<%
StringBuffer sb = new StringBuffer();
sb.append("<table>");
sb.append("<tr>");
sb.append("<td align=\"left\">");
sb.append("<bean:message key=\"label.register.fname\"/>:");
sb.append("</td>");
sb.append("<td>");
sb.append("<html:text property=\"firstName\"/>");
sb.append("</td>");
sb.append("</tr>");
sb.append("</table>");
out.println(sb);
%>
</html:form>


<html:messages id="message" message="true">
<bean:write name="message"/><br>
</html:messages>

</body>
<html>

Why use StringBuffer and simply display at the hmtl the code:

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html>
<head>
</head>
<body>
<font size="+1" color="#55BBEA">Not a member yet? Register here. It is FREE. </font><br>
<html:form action="/register">

<table>
<tr>
<td align="left">
<bean:message key="label.register.fname"/>:
</td>
<td>
<html:text property="firstName"/>
</td>
</tr>
</table>

</html:form>


<html:messages id="message" message="true">
<bean:write name="message"/><br>
</html:messages>

</body>
<html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.