0

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>
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by javaAddict
0

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>

Edited by javaAddict: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.