hi experts, i upload html file into db as byte[] in blob column, and in another part i have to retrieve this file and display in textarea, i'm able to retrieve from db as bytes and convert it into
string, but when display its shows as encrypt format, this is the
struts application.
this is my
jsp
---------------
<tr>
<td colspan="3" class="searchinput">
<html:textarea property="template" cols="100" rows="10" name="sendEmailForm">
</html:textarea>
</td>
</tr>
this is my form bean
-----------------------
private String template = null;
public String getTemplate() {
return template;
}
public void setTemplate(String template) {
this.template = template;
}
this is my bean
--------------------
private byte[] templateContent = null;
public String getHtmlTemplateContent() {
return templateContent.toString();
}
public byte[] getTemplateContent() {
return templateContent;
}
public void setTemplateContent(byte[] templateContent) {
this.templateContent = templateContent;
}
public void setTemplateContent(Object templateContent) {
this.templateContent = (byte[])templateContent;
}
this is my action
-------------------
templatesDataBean = (TemplatesDataBean)SendEmailManager.getTemplate(action, actor, sendEmailBean);
sendEmailForm.setTemplate(new String(templatesDataBean.getHtmlTemplateContent()));
how this can be solve, thanks in advance