jsp put.println() function

Hello, jsp gurus,

a simple question, why sometimes , out.println() doesn't  print anything ?

appreicte your reply.
Who is Participating?
I have encountered this problem myself and every time it was my fault.  jsp is a high level language and it is difficult to say what the compiler is thinking sometimes.  If there is an error in your page then it deffinatly won't print anything because it prints the error.

My best advice would be to comment out the section of code where you suspect the error exists and try again.  I'm sure you know what I'm talking about and you are probably trying to look at something that is very close to where the error occurs.  Sometimes you just have to crunch the code blind.  If it's any consolation I do know that the when the jsp code gets compiled it actually uses out.print to display plain text that you may be writing to the page.  Sometimes I think it gets confused between the code it writes and the code we write.  Anyway....  ....just work on that error and everything will be fine.

Chin up.
krishna kishore mellacheruvu venkataCommented:
means i didnt understand can u elaborate plz
lilyyanAuthor Commented:
problem solved. i'm doing a select query from a table. out.println(sqlRst.getString( 2 )); , if i use column number, it won't print anything. if i use filed name i.e. out.println(sqlRst.getString( field1));, it works.

Is it because you only selected one field in your query???
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.