My guess
would be Put braces around the statement eg
for (int k=0;k<30;k++)
{
String jj = "hello"+k;
}
The jsp compiler type program may not be able to resolve this properly !
-----Original Message-----
From: Khurram Mahmood [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 28, 1999 4:13 AM
To: [EMAIL PROTECTED]
Subject: Error in JRun????
The following code runs perfectly when used in any JVM:
for (int k=0;k<30;k++)
String jj = "hello"+k;
But gives the following error when run in a jsp file within <% ... %> tags.
com.livesoftware.scripting.CompilerException:
...
*** Syntax Error: "AssignmentOperator AssignmentExpression" inserted to
complete Assignment 2923.
String jj = "hello"+k;
<----^ *** Syntax Error: ";" inserted to complete ExpressionStatement
at
com.livesoftware.scripting.JavaCompiler.outProcessCompile(JavaCompiler.java,
Compiled Code)
at java.lang.Exception.(Exception.java, Compiled Code)
at com.livesoftware.scripting.CompilerException.(CompilerException.java,
Compiled Code)
at
com.livesoftware.scripting.JavaCompiler.outProcessCompile(JavaCompiler.java,
Compiled Code)
at com.livesoftware.scripting.JavaCompiler.compile(JavaCompiler.java,
Compiled Code)
at com.livesoftware.jrun.plugins.jsp.JSPCore.getPage(JSPCore.java, Compiled
Code)
at com.livesoftware.jrun.plugins.jsp.JSP.callPage(JSP.java, Compiled Code)
at com.livesoftware.jrun.plugins.jsp.JSP.service(JSP.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at com.livesoftware.jrun.JRun.runServlet(JRun.java, Compiled Code)
at com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java,
Compiled Code)
at com.livesoftware.jrun.JRunGeneric.handleProxyConnection(JRunGeneric.java,
Compiled Code)
at
com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(JR
unProxyServiceHandler.java, Compiled Code)
at
com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.ja
va, Compiled Code)
----------------------------
In order to avoid this, have to do the following, which is anyways a better
practice.
String jj = null;
for (int k=0;k<30;k++)
jj = "hello"+k;
Thanks.
KM
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html