I am getting some input from the user on client side with no limit on characters. So I am storing input as a BLOB data type.
I am directly getting my entity filled using getters and setters.
Action class:
public class OperatorNotesAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private OperatorNotesInfo note;
....
}
OperatorNotesInfo
is the entity I wana get filled. On client side I send the input filled by the user to the action class using JavaScript:
JS:
$.ajax({
type: 'POST',
url: "<s:url action='updateNote'/>",
data:
{
'note.title':$('#title').val(),
'note.id.operatorId':$('#operatorId').val(),
'note.content':$('textarea').val()
},
Here content is of byte array type in action class as it's stored as a BLOB.
How do I type convert the input entered by the user into byte array, so that content property of the entity note
gets saved ?