can't use out.println in function
Hello all i wrote a function using <%! fun(){ ' System.out.println("Hello"); ' ' ' } %> <% fun(); %> and call it from the main code every thing is working well but "Hello" is not printed why? no compile error is given Regards Vaishali Reliance Ind Ltd Ahmedabad === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: can't use out.println in function
On 5/10/02 11:30 PM, "[Vaishali S. Pandya]" <[EMAIL PROTECTED]> wrote: > Hello all > i wrote a function using > <%! > fun(){ > System.out.println("Hello"); > } > %> > <% >fun(); > %> > and call it from the main code every thing is working well but "Hello" is not > printed why? no compile error is given I haven't done too much JSP/Servlet programming in a while, but I am pretty sure that you need to direct your output to the correct print stream. Printing it out to system.out won't print it to regular "web" output. I'm guessing that you would need to print it out via the response object. Hopefully my answer is helpful -- like I said, it's been a while. Regards, Andy === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: can't use out.println in function
<%! fun(){ ' %>Hello<% ' ' } %> <% fun(); %> I think you can use the above instead of System.out.println("Hello"); === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: can't use out.println in function
no dear it is also not working and as per my calique, this statment will print the line on server(tomcat) try this Factorial <%! public static int fact(int i){ System.out.println(i); if (i==1){ return i; } return i*fact(i-1); } %> <% out.println(fact(5)); %> <%! fun(){ ' %>Hello<% ' ' } %> <% fun(); %> I think you can use the above instead of System.out.println("Hello"); === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: can't use out.println in function
Hai,I have tried the code u have given.It is working fine. System.out.println(0 will print on your tomcat. out.println will print on your web page.(it is printing too) What is your actual problem ? s.subramanian IonIdea Enterprise Solutions Bangalore. India. - Original Message - From: "[Vaishali S. Pandya]" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, May 11, 2002 3:59 PM Subject: Re: can't use out.println in function > no dear > it is also not working > and as per my calique, this statment will print the line on server(tomcat) > try this > > > Factorial > > > <%! > public static int fact(int i){ > System.out.println(i); > if (i==1){ >return i; > } > return i*fact(i-1); > } > %> > <% > out.println(fact(5)); > %> > > > > > > > > > <%! > fun(){ > ' > %>Hello<% > ' > ' > } > %> > <% > fun(); > %> > > I think you can use the above instead of System.out.println("Hello"); > > === > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: can't use out.println in function
I tried your code on IPlanet 6.0 webserver and there System.out worked fine after setting the out stream System.setOut(new PrintStream(new FileOutputStream("D:/TreasureHunt/Code/logs/error.log"))); The out.println will not work in the declared method as the out is declared and initialized in the service method when the jsp gets converted to servlet. Thus the out won't be accessible in the declared method. -Original Message- From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 11, 2002 4:00 PM To: [EMAIL PROTECTED] Subject: Re: can't use out.println in function no dear it is also not working and as per my calique, this statment will print the line on server(tomcat) try this Factorial <%! public static int fact(int i){ System.out.println(i); if (i==1){ return i; } return i*fact(i-1); } %> <% out.println(fact(5)); %> <%! fun(){ ' %>Hello<% ' ' } %> <% fun(); %> I think you can use the above instead of System.out.println("Hello"); === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com ==To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: can't use out.println in function
No SS out.println is printing only on server not on webpage here 120 will be printed on my page but all i will not, which i try to print in function. Hai,I have tried the code u have given.It is working fine. System.out.println(0 will print on your tomcat. out.println will print on your web page.(it is printing too) What is your actual problem ? s.subramanian IonIdea Enterprise Solutions Bangalore. India. - Original Message - From: "[Vaishali S. Pandya]" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, May 11, 2002 3:59 PM Subject: Re: can't use out.println in function > no dear > it is also not working > and as per my calique, this statment will print the line on server(tomcat) > try this > > > Factorial > > > <%! > public static int fact(int i){ > System.out.println(i); > if (i==1){ >return i; > } > return i*fact(i-1); > } > %> > <% > out.println(fact(5)); > %> > > > > > > > > > <%! > fun(){ > ' > %>Hello<% > ' > ' > } > %> > <% > fun(); > %> > > I think you can use the above instead of System.out.println("Hello"); > > === > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: can't use out.println in function
Hi Vaishali, make it out.println("Hello"); and it will work Manoj At 10:00 AM 5/11/2002 +0530, you wrote: >Hello all >i wrote a function using ><%! >fun(){ >' >System.out.println("Hello"); >' >' >' >} >%> ><% > fun(); >%> >and call it from the main code >every thing is working well but "Hello" is not printed >why? >no compile error is given > >Regards >Vaishali >Reliance Ind Ltd >Ahmedabad > >=== >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff >JSP-INTEREST". >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". >Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com > > >--- >Incoming mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.361 / Virus Database: 199 - Release Date: 5/7/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 5/7/2002
Re: can't use out.println in function
hi all actually the class i have to pass is JspWriter it works fine Thanks for the respond Vaishali Reliance Ind Ltd Ahmedabad Hi Vaishali, make it out.println("Hello"); and it will work Manoj At 10:00 AM 5/11/2002 +0530, you wrote: >Hello all >i wrote a function using ><%! >fun(){ >' >System.out.println("Hello"); >' >' >' >} >%> ><% > fun(); >%> >and call it from the main code >every thing is working well but "Hello" is not printed >why? >no compile error is given > >Regards >Vaishali >Reliance Ind Ltd >Ahmedabad > > === >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff >JSP-INTEREST". >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". >Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com > > >--- >Incoming mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.361 / Virus Database: 199 - Release Date: 5/7/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 5/7/2002 === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com