I have this form in keyword.jsp.
When the user clicks submit, it calls KeywordPostServlet.java to do some computation. When the computation is done, the user is directed to followMessage.jsp:
Depending on the "number of users to follow", it could be a very long time between when the user clicks submit and when the user sees the results. This is the computation in KeywordPostServlet.java:
for (int i = 0; i < tweets.size(); i++){
Status s = tweets.get(i);
twitter.createFriendship(s.getUser().getId());
msg += i+1 + ". Following @" + s.getUser().getScreenName() + ".<br/>";
}
request.setAttribute("message", msg);
request.getRequestDispatcher("/followMessage.jsp").forward(request, response);
And here is the code to display the results in followMessage.jsp:
<body>
<%
String msg = (String) request.getAttribute("message");
%>
<%=msg%>
</body>
How can I make it so that the user sees each person they're following in real-time, as opposed to just clicking submit and seeing the results all at once?