NutzCN Logo
问答 期望是整形或者是BigDecimal类型
发布于 376天前 作者 啊哈 495 次浏览 复制 上一个帖子 下一个帖子
标签:
	<input type="hidden" id="btnids" name="menu_btn" value="${obj.menu.menu_btn!''}"/> <!-- 复选框 -->

后台值obj.menu.menu_btn 为字符串'abc','def','g'

>>05:57:25:数组index错(ARRAY_INDEX_ERROR):menu_btn 位于33行 资源:/gov/menu/menuEdit.html
期望是整形或者是BigDecimal类型

请问这该怎么解决?

7 回复

完整报错信息

NATIVE_CALL_EXCEPTION
	at org.beetl.core.fun.SingleFunctionWrapper.call(SingleFunctionWrapper.java:100)
	at org.beetl.core.statement.FunctionExpression.evaluate(FunctionExpression.java:87)
	at org.beetl.core.statement.FunctionExpression.evaluate(FunctionExpression.java:82)
	at org.beetl.core.statement.TernaryExpression.evaluate(TernaryExpression.java:60)
	at org.beetl.core.statement.PlaceholderST.execute(PlaceholderST.java:34)
	at org.beetl.core.statement.BlockStatement.execute(BlockStatement.java:68)
	at org.beetl.core.statement.IfStatement.execute(IfStatement.java:63)
	at org.beetl.core.statement.BlockStatement.execute(BlockStatement.java:68)
	at org.beetl.core.statement.IfStatement.execute(IfStatement.java:63)
	at org.beetl.core.statement.BlockStatement.execute(BlockStatement.java:68)
	at org.beetl.core.statement.ForStatement.execute(ForStatement.java:144)
	at org.beetl.core.statement.Program.execute(Program.java:70)
	at org.beetl.core.engine.FilterProgram.execute(FilterProgram.java:31)
	at org.beetl.core.Template.renderTo(Template.java:136)
	at org.beetl.core.Template.renderTo(Template.java:102)
	at org.beetl.ext.web.WebRender.render(WebRender.java:120)
	at org.beetl.ext.nutz.BeetlView.render(BeetlView.java:28)
	at org.nutz.mvc.view.ViewZone.render(ViewZone.java:51)
	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:60)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Error:replace(null)
	at org.beetl.ext.fn.StringUtil.replace(StringUtil.java:115)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.beetl.core.om.ObjectUtil.invoke(ObjectUtil.java:552)
	at org.beetl.core.om.ObjectUtil.invoke(ObjectUtil.java:508)
	at org.beetl.core.om.ObjectUtil.invokeObject(ObjectUtil.java:533)
	at org.beetl.core.fun.SingleFunctionWrapper.call(SingleFunctionWrapper.java:65)
	... 53 more
2017-11-10 09:14:24:[DEBUG][ org.beetl.ext.nutz.LogErrorHandler.processExcption(LogErrorHandler.java:32)] [org.beetl.ext.nutz.LogErrorHandler]:调用方法出错 strutil.replace
>>09:14:24:调用方法抛出了异常(NATIVE_CALL_EXCEPTION):strutil.replace 位于76行 资源:/gov/menu/menuEdit.html
调用方法出错 strutil.replace
73|    @for(var itemBtn in obj.btn){
74|        @if(itemBtn.type==1){
75|        @if(obj.menu.menu_btn!=''){
76|        <input type="checkbox" ${strutil.contain(strutil.replace(obj.menu.menu_btn!,'\'',''),itemBtn.id)?'checked':''} value="${itemBtn.id}"  title="${itemBtn.name}" lay-skin="primary" lay-filter="menu_btn"> 
77|        @}else{
78|        
79|        @}
java.lang.NullPointerException: Error:replace(null)
	at org.beetl.ext.fn.StringUtil.replace(StringUtil.java:115)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.beetl.core.om.ObjectUtil.invoke(ObjectUtil.java:552)
	at org.beetl.core.om.ObjectUtil.invoke(ObjectUtil.java:508)
	at org.beetl.core.om.ObjectUtil.invokeObject(ObjectUtil.java:533)
	at org.beetl.core.fun.SingleFunctionWrapper.call(SingleFunctionWrapper.java:65)
	at org.beetl.core.statement.FunctionExpression.evaluate(FunctionExpression.java:87)
	at org.beetl.core.statement.FunctionExpression.evaluate(FunctionExpression.java:82)
	at org.beetl.core.statement.TernaryExpression.evaluate(TernaryExpression.java:60)
	at org.beetl.core.statement.PlaceholderST.execute(PlaceholderST.java:34)
	at org.beetl.core.statement.BlockStatement.execute(BlockStatement.java:68)
	at org.beetl.core.statement.IfStatement.execute(IfStatement.java:63)
	at org.beetl.core.statement.BlockStatement.execute(BlockStatement.java:68)
	at org.beetl.core.statement.IfStatement.execute(IfStatement.java:63)
	at org.beetl.core.statement.BlockStatement.execute(BlockStatement.java:68)
	at org.beetl.core.statement.ForStatement.execute(ForStatement.java:144)
	at org.beetl.core.statement.Program.execute(Program.java:70)
	at org.beetl.core.engine.FilterProgram.execute(FilterProgram.java:31)
	at org.beetl.core.Template.renderTo(Template.java:136)
	at org.beetl.core.Template.renderTo(Template.java:102)
	at org.beetl.ext.web.WebRender.render(WebRender.java:120)
	at org.beetl.ext.nutz.BeetlView.render(BeetlView.java:28)
	at org.nutz.mvc.view.ViewZone.render(ViewZone.java:51)
	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:60)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)



错了,不是上面的

啥意思?什么不是上面的?

详细日志里面报错是obj.menu.menu_btn为null咯

ARRAY_INDEX_ERROR 

 at org.beetl.core.om.ListAA.value(ListAA.java:59)	at org.beetl.core.statement.VarAttribute.evaluate(VarAttribute.java:61)	at org.beetl.core.statement.VarRef.evaluate(VarRef.java:127)	at org.beetl.core.statement.PlaceholderST.execute(PlaceholderST.java:34)	at org.beetl.core.statement.Program.execute(Program.java:70)	at org.beetl.core.Template.renderTo(Template.java:136)	at org.beetl.core.Template.renderTo(Template.java:102)	at org.beetl.ext.web.WebRender.render(WebRender.java:120)	at org.beetl.ext.nutz.BeetlView.render(BeetlView.java:28)	at org.nutz.mvc.view.ViewZone.render(ViewZone.java:51)	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:60)	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)	at java.lang.Thread.run(Unknown Source)2017-11-10 09:18:26:[DEBUG][ org.beetl.ext.nutz.LogErrorHandler.processExcption(LogErrorHandler.java:32)] [org.beetl.ext.nutz.LogErrorHandler]:

期望是整形或者是BigDecimal类型>>09:18:26:

数组index错(ARRAY_INDEX_ERROR):menu_btn 位于33行 

资源:/gov/menu/menuEdit.html期望是整形或者是BigDecimal类型 

30|<body> 

31| 

32|<form id="myform" class="layui-form layui-form-pane" action=""> 

33|	<input type="hidden" id="btnids" name="menu_btn" value="${obj.menu.menu_btn!''}"/> <!-- 复选框 --> 



34|	<input type="hidden" id="pid" name="pid"  value="${obj.menu.pid!}"> <!-- 父级菜单 --> 

35|	<input type="hidden" value="${obj.menu.images!}" name="images"  id="imgval"> <!-- 图片地址 --> 

36|  <div class="layui-form-item">

这个错误日志。

已解决!
有说明啊,beetl.properties 里的配置加一个ENGINE=org.beetl.core.engine.DefaultTemplateEngine

官网文档也有说明

哦(´-ω-`),这个坑果然很多人踩

添加回复
请先登陆
回到顶部