I'm not getting ,how this out.println() works ,can someone explain ,just eager to know ,how it get's handled .
In my scenario i send data to servlet through request object , in servlet
| below (and i'm using out.println() to send the data) , i don't see the display of the data (the thing i have given in servlet) and it's moved to "result.jsp" without giving display to the servlet. !!
My question is
1) Is the response is sent when i use out.println() in the servlet , (if it was sent both request and response might have got de-referenced but i get "result.jsp" , i guess i don't know what's happening). Is "out.println() statement is working or not"
PrintWriter is a stream. Your calls to println() put messages on the stream to be output "later." They don't get sent to the browser right away. They get sent when you call flush() or close(). See this example. You use flush() when you want to write more in the same servlet (like in a download - you want to start downloading something while you get the rest of the data.) You use close() at the end.