Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: My data got posted into my database but there's no message shown to user on broswer.

  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default My data got posted into my database but there's no message shown to user on broswer.

    I have a Post servlet which will inform user that the information is captured.

    After the form is submitted, my browser is all blank. It is supposed to give me a message.

    The data was captured in my database though.

     
     PrintWriter out = response.getWriter();
       ps.executeUpdate();
                        out.println("Successful registration. Member account has been created");

    But, I'm not seeing this message in my browser - both IE and firefox.

    I thought I have put in the printwriter stuff and it should be working fine.

    Then, I went on to add on these lines to see if it works but it didn't (

     
    response.setContentType("text/html");
                        out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
                                            "Transitional//EN\">\n" +
                    "<HTML>\n" +
                    "<HEAD><TITLE>Successful Registration.</TITLE></HEAD>\n" +
                    "<BODY>\n" +
                    "<H1>Hello WWW</H1>\n" +
                    "</BODY></HTML>";

    Is there anything I have missed out?


  2. #2
    Junior Member
    Join Date
    Jul 2013
    Location
    uk
    Posts
    15
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default Re: My data got posted into my database but there's no message shown to user on broswer.

    Hello
    if the message you want the user to see after he/she had submitted a form, then you would refresh the page for the message to appear. you can do that through the meta tag.
    Thanks

  3. #3
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: My data got posted into my database but there's no message shown to user on broswer.

    Hello.
    Probably there could be exception in your servlet. In the catch block try to add out.println("Exception Occured!!"). And in the try block add out.println("Success!!").
    Let me know.

    Syed.

Similar Threads

  1. [SOLVED] GUI user input error message
    By deeevo in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 24th, 2013, 02:00 AM
  2. Multiple User's Data
    By RLS0812 in forum Object Oriented Programming
    Replies: 1
    Last Post: February 19th, 2012, 05:19 PM
  3. Streaming Raw Data to a Client - huge message loss
    By MarkusTandy in forum Java Networking
    Replies: 0
    Last Post: February 19th, 2011, 07:41 PM
  4. Storing User Data
    By aussiemcgr in forum Java Theory & Questions
    Replies: 1
    Last Post: January 21st, 2011, 09:07 AM