• Post Reply Bookmark Topic Watch Topic
  • New Topic

out.println is not working  RSS feed

 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


code from Last out.println() is not getting printed in the response. Whats the problem.
There is not mistake in logic of the code , and that last for loop does executes.
Any clue
 
Paul Clapham
Sheriff
Posts: 22505
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So are you saying that your output includes </body> but not </html>?

I haven't looked at your code much; when I noticed that the indentation was very inconsistent, and that you seemed to be asking about some for-loop somewhere, I realized that I would not be able to understand the code's structure without a great deal of work. If you want people to read and understand your code, it would help if you didn't make it so hard for them.
 
Paul Clapham
Sheriff
Posts: 22505
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... now I notice that when you said "Last out.println" you didn't really mean the last instance of "out.println". You had some of your question in your code, which as I said I couldn't really read. It would help if you didn't do that, too.
 
Nilay Mitash
Greenhorn
Posts: 19
Hibernate Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not an expert but I think to use out.println() instead of System.out.println(), you need to import the location of out object. i.e in the System class.

add this to the top of the code and see if it works.

import static java.lang.System.out;

And please do correct me if I am wrong and if I did not understand your question.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nilay Mitash wrote:I am not an expert but I think to use out.println() instead of System.out.println(), you need to import the location of out object. i.e in the System class.

No. This is a servlet, and the question has nothing to do with System.out, but with the response output stream.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!