Storing New Comments

If the t parameter is not set to “1”, chat.html may be trying to tell you that the user is sending you new comments. The text field you see in Figure 5.1 is named text1, and the text area is named textarea1. If there is already text in those two controls, you should store the user's new comments from the text area in the text0 through text7 strings. You can start by recovering all the current user comments:

 <% } else{ if(request.getParameter("textarea1") != null){ String name = request.getParameter("text1"); String text0 = (String) application.getAttribute("text0"); String text1 = (String) application.getAttribute("text1"); String text2 = (String) application.getAttribute("text2"); String text3 = (String) application.getAttribute("text3"); ...

Get Java™ After Hours: 10 Projects You'll Never Do at Work now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.