1

BalusC, thank you for your attention but it is a different matter. I do not have any problem to send the value. My problem is to put it back, if anything was written, on the textArea. It is the opposite, I'd tried to explain it better :

My aim is first to save the textarea (no problem) then, if something was written, I want to display it in the textarea. That last part is a problem.

Exemple : Imagine you write something in the textarea but don't have time to finish : you save it (send to servlet), and it is still on display in case you want to edit (I have to send it back to the textarea - which is my problem -).

The value parameter doesn't exist for textarea (as it is with an input), so I've tried this but it doesn't work. The only lead I could find on the internet was to use JavaScript and I would rather not. It works great with an input but it is not as comfy for the user when he writes a lot. Any idea or lead of what I could try?

<form method="post" action="edit" >
<input type="submit" value="Enregistrer ma traduction" id="save">
<p><textarea type="text" class = "traduction" name="${ stat }"
id="${ stat }" cols="40" rows="5" placeholder="essai traduction">

<c:if test="${ !empty stat }"><c:out value="${ stat }"/>
</c:if></textarea></p>

</form>

this is my doPost method in the servlet :

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String stat = request.getParameter("stat");
    request.setAttribute("stat", stat);
    this.getServletContext().getRequestDispatcher("/WEB-INF/edit_sub.jsp").forward(request, response);
}

thank you for your help.

kermit
  • 11
  • 3

0 Answers0