jsp put.println() function

Posted on 2005-04-06
Last Modified: 2012-05-05
Hello, jsp gurus,

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

appreicte your reply.
Question by:lilyyan
    LVL 10

    Expert Comment

    by:krishna kishore mellacheruvu venkata
    means i didnt understand can u elaborate plz
    LVL 12

    Accepted Solution

    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.

    Author Comment

    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.
    LVL 12

    Expert Comment


    Is it because you only selected one field in your query???

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    It can often be challenging to stay relevant in the rapidly evolving world of technology. This can make recruiting talent difficult for companies of all sizes.
    Outlook Free & Paid Tools
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now