You cannot use out in a declaration section, its available only in the
scriplet sections coz they are compiled into service method of a
servlet.

Dani

----- Mensaje Original -----
De: Anthony Mak <[EMAIL PROTECTED]>
Fecha: Mi�rcoles, Noviembre 15, 2000 6:50 am
Asunto: 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
>


________________________________________________________________
Consigue tu cuenta gratuita de acceso a internet y de correo en
http://www.navegalia.com

===========================================================================
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