1

I was using a textarea for taking user text input, but in order to retain the text formatting decided to try out tinyMCE.

What I need to do:

  1. Save the input entered into the tinyMCE editor to the database by posting the content to a servlet.
  2. Retrieve the saved text from the server and display it in the tinyMCE for any editing.

Problem Description: This is how I sent the text retrieved from the server to the front end JSP:

request.setAttribute('inputText',txt);
RequestDispatcher view = request.getRequestDispatcher("/TextareaTest.jsp");
view.forward(request, response);

In the JSP page I use JSTL/EL only. So to access the value in the request object I use ${requestScope['inputText']} or ${inputText}

Example:

<script type="text/javascript">
var txt = "${requestScope['inputText']}";
tinyMCE.get('textarea1').setContent(txt);
</script>

But this does not work with tinyMCE. Somehow I am not able to access the request object like I was able to before integrating tinyMCE. If I remove tinyMCE, it works fine. But now its like a normal textarea.

need to figure out how to access the value set on the request object by the servlet inside the javascript function.

Thanks

4

1 に答える 1

0

私はそれを働かせました。問題を引き起こしていると思われるエディター インスタンスで save() を呼び出そうとしました。私はそれを削除し、sessionScopeにアクセスできます

于 2013-01-25T11:46:09.583 に答える