You are using the call incorrectly.  You need to assign the result to a
string, not just call the method.

#YANG YUE XIANG# wrote:
>
> Hi,
>
> I meet a problem in the servlets. I don't know why the concat()method has no
> effects.
> No error , no results. Just Like a blank line.
>
> public void doGet (HttpServletRequest request,
>                            HttpServletResponse response)
>         throws ServletException, IOException
>         {
>            String ipaddress = new String(request.getRemoteAddr());
>            if (!ipname.containsKey(ipaddress))
>            {
>            ipname.put(request.getRemoteAddr(),request.getParameter("name"));
>            iprequest.put(request.getRemoteAddr(),request);
>            ipresponse.put(request.getRemoteAddr(),response);
>            }
>
> // this line has no effects?????why??
> //content has been initialized in the constructor as:
> //content = new String(":");
>
>            content.concat(new String("~~~~~~~\n"));
>
>             response.setContentType("text/html");
>
>             PrintWriter out = response.getWriter();
>             out.println("<html>");
>             out.println("<body>");
>             out.println("<FORM action=\"http://155.69.22.31:8080/chat/chat\"
> method=\"post\">");
>             out.println("<P>");
>             out.println("<LABEL for=\"We are talking!\">We are talking!:
> </LABEL><BR>");
>             out.println("<TEXTAREA name=\"history\" rows=\"12\"
> cols=\"50\">");
>             out.println(content);
>             out.println("</TEXTAREA><BR>");
>             out.println("<LABEL for=\"I am speaking!\">I am speaking!:
> </LABEL><BR>");
>             out.println("<input type=text size=40 name=message>");
>             out.println("<INPUT type=\"submit\" value=\"Send\"><INPUT
> type=\"reset\">");
>             out.println("</P>");
>             out.println("</FORM>");
>             out.println("</body>");
>             out.println("</html>");
>         }
>
> Thanksvery much!
>
> Yang

--
Julio C. Monroy
Chief Information Officer
MallPhoria!
1400 Fashion Island Boulevard
Suite 940
San Mateo, California 94404
p: 650-349-0300
f: 650-571-1025
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to