i think what you got to do is like the following :
1st - declare your ACE editor with the div like the following :
<body onload="onloadPage()">
<form method="post" id="divdata" action="mygeco" target="_blank" >
<div id="editor">
User enters some text here
</div>
<textarea id="textArea" ></textarea>
<input type="button" onclick="submitForm()" value="Button"/>
</form>
</body>
2nd - onloadPage() :
function onloadPage()
{
// hide the textArea
document.getElementById('textArea').style.display = "none";
}
3rd - submitForm() :
function submitForm() {
var editor = ace.edit("editor");
var code = editor.getSession().getValue();
document.getElementById('textArea').style.display = "block";
document.getElementById('textArea').value=code;
document.getElementById("divdata").submit();
}
4th - get the value in the servlet :
String textArea=request.getParameter("textArea");
and please give me feedback .
Hope that helps .