You can get the page refreshed automatically.
and you can save all the message in server side, when
the page asked for refresh, send them back.
--- chinto_net <[EMAIL PROTECTED]> wrote:
>
>
>
>
> hi ;
>
> i am developing beginers level chat room servlet. i
> have done all
> the session tracking part and sending part of it.
> i can make users to connect to same session . but i
> am having probe
> in the reciving part and the format in which msg can
> be recived.
>
> for example if user A send msg to user b the user B
> can not see the
> msg until he /she post a msg to user A. I mean
> session isnt
> refreshing it self when msg are send .
>
> and secondly he or she can see only last msg rather
> then entire
> conversational.
>
> if any one can lead me to source where i can find
> example of
> beginers level that would be great full. or
> suggestion about the
> correction in existing code.i am pasting a source of
> mine i havent
> formatted the HTML yet ..
>
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.util.*;
>
> public class Servlet1 extends HttpServlet {
>
>
> String oipt;
> //Initialize global variables
> public void init(ServletConfig config) throws
> ServletException {
> super.init(config);
> }
>
> //Process the HTTP Post request
> public void doPost(HttpServletRequest request,
> HttpServletResponse
> response) throws ServletException, IOException {
> response.setContentType("text/html");
> PrintWriter out = new PrintWriter
> (response.getOutputStream());
> String s=request.getParameter("a");
>
>
>
> HttpSession se=request.getSession(true);
> Integer c=(Integer)se.getValue("c");
>
> c= new Integer(1521);
> se.putValue("c",c);
> String ipt =request.getParameter("a");
> out.println("<html>");
>
> out.println("<head><title>Servlet1</title></head>");
> out.println(se.getValue("c").toString());
> out.println("<body>");
> out.print("<FORM
>
action=http://localhost:8080/servlet/untitled2.Servlet1
>
> method=POST>");
> out.println(oipt);
> out.println(ipt);
> oipt=ipt ;
> out.println("<input type=text name=a>");
> out.print("<input type=submit
> value=Submit><input type=reset
> value=Reset></form>");
> out.println("</body></html>");
> out.close();
> }
>
> //Get Servlet information
> public String getServletInfo() {
> return "untitled2.Servlet1 Information";
> }
> }
>
>
>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Make a clean sweep of pop-up ads. Yahoo! Companion
> Toolbar.
> Now with Pop-Up Blocker. Get it for free!
>
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/5cFolB/TM
>
--------------------------------------------------------------------~->
>
>
> If you have any comments or questions, submit it on
> the message board.
> NO spam/ads/job posting or you will be BANNED from
> this group. Exception can be made it happen by
> notify me ahead of time.
> all new members' message will be verified by me
> (spam..) before it get posted.
> Yahoo! Groups Links
>
>
> [EMAIL PROTECTED]
>
>
>
>
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/5cFolB/TM
--------------------------------------------------------------------~->
If you have any comments or questions, submit it on the message board.
NO spam/ads/job posting or you will be BANNED from this group. Exception can be
made it happen by notify me ahead of time.
all new members' message will be verified by me (spam..) before it get posted.
Yahoo! Groups Links
<*> To reply to this message, go to:
http://groups.yahoo.com/group/java_official/post?act=reply&messageNum=17408
Please do not reply to this message via email. More information here:
http://help.yahoo.com/help/us/groups/messages/messages-23.html
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/java_official/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/