当用使用ssh框架,前端用到kindeitor富文本编辑器时候,上传文件后有一个图片管理.当点击图片管理的时候,在后台会报一个异常:

WARN OgnlValueStack:68 - Error setting value [[Ljava.lang.String;@10da4df] with expression [1501984936145]
java.lang.NumberFormatException: For input string: "1501984936145"1501985270344
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:495)
    at java.lang.Integer.valueOf(Integer.java:556)
    at ognl.OgnlParserTokenManager.makeInt(OgnlParserTokenManager.java:63)
    at ognl.OgnlParserTokenManager.TokenLexicalActions(OgnlParserTokenManager.java:1624)
    at ognl.OgnlParserTokenManager.getNextToken(OgnlParserTokenManager.java:1498)
    at ognl.OgnlParser.jj_ntk(OgnlParser.java:3099)
    at ognl.OgnlParser.unaryExpression(OgnlParser.java:1079)
    at ognl.OgnlParser.multiplicativeExpression(OgnlParser.java:971)
    at ognl.OgnlParser.additiveExpression(OgnlParser.java:894)
    at ognl.OgnlParser.shiftExpression(OgnlParser.java:750)
    at ognl.OgnlParser.relationalExpression(OgnlParser.java:508)
    at ognl.OgnlParser.equalityExpression(OgnlParser.java:405)
    at ognl.OgnlParser.andExpression(OgnlParser.java:352)
    at ognl.OgnlParser.exclusiveOrExpression(OgnlParser.java:299)
    at ognl.OgnlParser.inclusiveOrExpression(OgnlParser.java:246)
    at ognl.OgnlParser.logicalAndExpression(OgnlParser.java:193)
    at ognl.OgnlParser.logicalOrExpression(OgnlParser.java:140)
    at ognl.OgnlParser.conditionalTestExpression(OgnlParser.java:101)
    at ognl.OgnlParser.assignmentExpression(OgnlParser.java:64)
    at ognl.OgnlParser.expression(OgnlParser.java:23)
    at ognl.OgnlParser.topLevelExpression(OgnlParser.java:15)
    at ognl.Ognl.parseExpression(Ognl.java:110)
    at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:332)
    at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:282)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:186)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:173)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:151)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:303)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:221)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
    at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

这个异常是由于kindeditor为了避免浏览器缓存,于是在后台链接里面加上了当前时间,作为一个参数传递.

而struts2框架对于这个传递过来的string类型的数据(其实应该是long类型的),解析成了integer类型的数据了,所以就会报解析异常.因为long类型的数当长度大于int类型的话,就会报一个转换异常.而struts2就会报一个解析异常.

解决办法:

在防止string类型数据被解析,修改一下传递的数据url.

在kindeditor源文件里面,找到filemanager.js文件,修改其中的第75行代码,

function reloadPage(path, order, func) {
var param = 'path=' + path + '&order=' + order + '&dir=' + dirName;
dialog.showLoading(self.lang('ajaxLoading'));
K.ajax(K.addParam(fileManagerJson, param + '&' + new Date().getTime()), function(data) {
dialog.hideLoading();
func(data);
});
}

把原先的fileManagerJson, param + '&' + new Date().getTime()这个代码中'&'字符后面加一个'='等号即可

示例代码

function reloadPage(path, order, func) {
var param = 'path=' + path + '&order=' + order + '&dir=' + dirName;
dialog.showLoading(self.lang('ajaxLoading'));
K.ajax(K.addParam(fileManagerJson, param + '&=' + new Date().getTime()), function(data) {
dialog.hideLoading();
func(data);
});
}

fileManagerJson, param + '&=' + new Date().getTime().

有效避免struts去解析字符串

亲测有效

解决kindeidtor与struts2框架交互WARN OgnlValueStack:68 - Error setting value [[Ljava.lang.String;@10da4df]的bug的更多相关文章

  1. OgnlValueStack:49 - Error setting expression 'sfjmyh.zdyx6' with value '[Ljava.lang.String;@28d320d6'

    作过户管理流程时,提交表单后控制台显示如下错误 : WARN com.opensymphony.xwork2.ognl. OgnlValueStack:60 - Error setting expre ...

  2. com.opensymphony.xwork2.ognl.OgnlValueStack] - target is null for setProperty(null, "emailTypeNo", [Ljava.lang.String;@6f205e]

    情况1,查询结果未转换为与前台交互的实体类DTO 实体类:EmailTypeDto package com.manage.email.dto; public class EmailTypeDto { ...

  3. 解决ThinkPHP3.2.3框架,PDO驱动查询出来的字段名全是小写的bug

    找到文件:ThinkPHP\Library\Think\Db\Driver.class.php 找到代码: // PDO连接参数 protected $options = array( PDO::AT ...

  4. java.lang.ClassNotFoundException: [Ljava.lang.String解决办法

    原来jdk5.0的时候不会报这个错,用了jdk6.0就出现了这个错误,因为没有重载java.lang.String这个类 解决方法: 在vm缺省参数里添加-Dsun.lang.ClassLoader. ...

  5. mybaits错误解决:There is no getter for property named 'parentId ' in class 'java.lang.String'

    在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter来代替参数名. 比如mapper中如下方法,只有一个String值 publ ...

  6. 解决Exception: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z

    在项目中添加src中添加NativeIO类 /** * Licensed to the Apache Software Foundation (ASF) under one * or more con ...

  7. mybaits错误解决:There is no getter for property named 'id' in class 'java.lang.String'

    在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter 来代替参数名. 正确的写法: <span style="f ...

  8. 解决org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z

    这个问题来的有点莫名奇妙,之前我的hadoop运行一直是正常的,某一天开始运行Mapreduce就报这个错. 试过很多种方法都没有用,比如 1.path环境变量2.Hadoop bin目录下hadoo ...

  9. com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression 'customer.applyRate' with value '[Ljava.lang.String;@7d3fae2c'

    出错的3个最可能的原因:我是第二种错误 1.action配置错误 <action name="doCreateMeetingInfo" class="meeting ...

随机推荐

  1. Linux kernel 之 uart 驱动解析

    uart 是一种非常之常见的总线,比如DEBUG信息输出,小数据量数据传输,485,以及蓝牙的控制,GPS,很多都是通过uart 进行数据传输并进行控制. 在Linux kernel 内部,uart ...

  2. [driver]/lib/modules

    两个路径: /lib/modules/4.1.6/updates/net/wireless/cfg80211.ko /lib/modules/4.1.6/modules.dep

  3. mysql实现经纬度计算两个坐标之间的距离sql语句

    select *,(2 * 6378.137* ASIN(SQRT(POW(SIN(PI()*(111.86141967773438-latitude)/360),2)+COS(PI()*33.070 ...

  4. Deep learning for Human Strategic Behaviour

    没看,但是论文UI和视频做的很好. 论文地址:https://papers.nips.cc/paper/6509-deep-learning-for-predicting-human-strategi ...

  5. python 2.7安装某些包出现错误:"libxml/xmlversion.h:没有那个文件或目录"

    解决办法: 1. ubuntu系统: 首先: apt-get install libxml2-dev sudo ln -s /usr/include/libxml2/libxml /usr/inclu ...

  6. MyBatis学习4---使用MyBatis_Generator生成Dto、Dao、Mapping

    由于MyBatis属于一种半自动的ORM框架,所以主要的工作将是书写Mapping映射文件,但是由于手写映射文件很容易出错,所以查资料发现有现成的工具可以自动生成底层模型类.Dao接口类甚至Mappi ...

  7. java为安全起见对Applet有所限制

    Applet消亡的原因: ①java为安全起见对Applet有所限制:Applet不允许访问本地文件信息.敏感信息,不能执行本地指令(比如FORMAT),不能访问初原服务器之外的其他服务器. ① IE ...

  8. hdu 5065 数学题

    #include<iostream> #include<cmath> #include<cstdio> using namespace std; int A,B,y ...

  9. c#用run32dll打开系统dll(如系统图片查看器,并置最顶层)

    [DllImport("user32.dll", EntryPoint = "SetWindowPos",CharSet = CharSet.Auto)] st ...

  10. WebService的初级学习

    复习准备 1. Schema约束: 1.1   namespace相当于Schema文件的id: 1.2   targetNamespace属性用来指定schema文件的namespace的值; 1. ...