0

Error use generic java type in zscript tag!

asked 2009-07-01 11:54:16 +0800

kgibrank gravatar image kgibrank
48 1

updated 2009-07-01 11:55:35 +0800

Hi,
I have noticed that using the generic java type in zscript tag, it generates an error of type bsh.ParseException after deploying my applizione:
EXAMPLE:

<zk>
<window id="mywin" border="none">
 <zscript>
<![CDATA[
//@IMPORT
import it.example.Users;
]]>	
 <![CDATA[
List<Users> usrs = new ArrayList<Users>();
]]>						
</zscript>
</window>
</zk>

ERROR:

[13:42:41.789]org.zkoss.zk.ui.UiException: Parse error at line 9, column 5.  Encountered: =
[13:42:41.789]	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[13:42:41.789]	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[13:42:41.789]	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[13:42:41.789]	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[13:42:41.789]	at org.zkoss.lang.Classes.newInstance(Classes.java:78)
[13:42:41.789]	at org.zkoss.lang.Exceptions.wrap(Exceptions.java:164)
[13:42:41.789]	at org.zkoss.zk.ui.UiException$Aide.wrap(UiException.java:46)
[13:42:41.789]	at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:122)
[13:42:41.789]	at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:310)
[13:42:41.789]	at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:787)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execNonComponent(UiEngineImpl.java:753)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:553)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:498)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:631)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:587)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:531)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:498)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:631)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:587)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:531)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:498)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:631)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:587)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:531)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:498)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:631)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:587)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:531)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:563)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:531)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:498)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:378)
[13:42:41.789]	at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:299)
[13:42:41.789]	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:230)
[13:42:41.789]	at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:166)
[13:42:41.789]	at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
[13:42:41.789]	at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
[13:42:41.789]	at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
[13:42:41.789]	at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
[13:42:41.789]	at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
[13:42:41.789]	at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
[13:42:41.789]	at com.caucho.server.port.TcpConnection.run(TcpConnection.java:514)
[13:42:41.789]	at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520)
[13:42:41.789]	at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
[13:42:41.789]	at java.lang.Thread.run(Thread.java:619)
[13:42:41.789]Caused by: Parse error at line 9, column 5.  Encountered: =
[13:42:41.789]	at bsh.Parser.generateParseException(Unknown Source)
[13:42:41.789]	at bsh.Parser.jj_consume_token(Unknown Source)
[13:42:41.789]	at bsh.Parser.Statement(Unknown Source)
[13:42:41.789]	at bsh.Parser.BlockStatement(Unknown Source)
[13:42:41.789]	at bsh.Parser.Line(Unknown Source)
[13:42:41.789]	at bsh.Interpreter.Line(Unknown Source)
[13:42:41.789]	at bsh.Interpreter.eval(Unknown Source)
[13:42:41.789]	at bsh.Interpreter.eval(Unknown Source)
[13:42:41.789]	at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:119)
[13:42:41.789]	... 37 more

ORAZIO

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-07-01 14:09:37 +0800

YamilBracho gravatar image YamilBracho
1722 2

I thinks BeanShell does not support generics so you can change your code to:

<zk>
<window id="mywin" border="none">
 <zscript>
<![CDATA[
//@IMPORT
import it.example.Users;
]]>	
 <![CDATA[
List usrs = new ArrayList();
]]>						
</zscript>
</window>
</zk>

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-07-01 11:54:16 +0800

Seen: 296 times

Last updated: Jul 01 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More