Hi

Sorry guy!
I have forgotten one thing
 in definition part <%! ... %> all implicit JSP Page object are unreachable
so :

1. System.out.println -- You can see it in tomcat window ( if it is not an
system service )
2. You should do this

<%
        HttpServletRequest              sRequest;
        HttpServletResponse             sResponse;
        HttpSession                     sSession;
        PrintWriter                             sOut;

        sRequest = request;
        sResponse = response;
        sSession = request.getSession(false);
        (
        or
        sSession = session;
        )
        sOut = out;
%>

Regards

Valik.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Yang cun dong
Sent: Thursday, November 02, 2000 3:10 PM
To: [EMAIL PROTECTED]
Subject: Re: Function Defining in JSP Page...


V.A. Kozhevnykov
 I have try it on Tomcat3.1+win98+jdk1.2.2,but it produce errors as follows.
Error: 500
Location: /website/index/file/jsp/function.jsp
Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSPC:\tomcat\work\localhost_8080\_0002fwebsite_0002findex_0002ffile_0002fjsp
_0002ffunction_0002ejspfunction_jsp_1.java:26: Undefined variable or class
name: out
               out.println("We are do something in the Function!");
               ^
1 error

        at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled Code)
        at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:149)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:161)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java, Compiled Code)
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)

 after i revised out.println to System.out.println,it passes,but it has no
display of the function.



ÔÚ 00-11-3 14:46:00 ÄúдµÀ£º
>Hi
>
>>hi all,
>>how do u define and call a function in a jsp page..
>>Please if possible send a sample code.
>>Nova
>
><%
>// Main page processing part
>
>        out.println("now call Do SMTHG");
>        doSMTNG();
>
>%>
>
>
><%!
>// Definition Part
>
>public(private) void doSMTNG()
>{
>        out.println("in Do SMTHG");
>}
>
>%>
>
>
>good luck
>Valik
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.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

                    ÖÂ
Àñ£¡

            ycd
            [EMAIL PROTECTED]

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


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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