• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

out.println is not working

 
Ranch Hand
Posts: 391
1
MySQL Database PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 19
Mac Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic