The implicit objects, one of which is out, are only available in the _jspService method. There for you would need pass the jspwriter object to your method printHello, before using it. Have a nice day. With regards, Sachin S. Khanna. www.emailanorder.com ----- Original Message ----- From: Anthony Mak <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 15, 2000 11:20 AM Subject: Declaring a function? > Dear all, > > I am trying to define a function that print out somethng to the screen. The > following is my code which always generate an error message when the JSP > Server try to translate it. Is it not possible to put print() statement in > the <%! %> declaration section? > > /****** CODE *****/ > > <HTML> > <BODY> > <%! > public void printHello(){ > out.print("Hello World"); > } > %> > <% > printHello(); > %> > </BODY> > </HTML> > > /***** ERROR MESSAGE *****/ > > javax.servlet.ServletException: Compilation error occured: > Found 1 errors in JSP file: > C:\\Program Files\\Allaire\\JRun\\servers\\default\\bus\\test_func.jsp:5: > Error: "out" is either a misplaced package name or a non-existent entity. > > Anthony Mak > > =========================================================================== > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to