帆软下钻报表报错Invalid character found in the request target.The valid characters are defined in RFC 7230

Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

谷歌浏览器正常运行

 

IE浏览器下钻报表报错:

 

HTTP Status 400 – Bad Request


Type Exception Report

Message Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

Exception
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:483)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:684)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)


Note The full stack trace of the root cause is available in the server logs.


Apache Tomcat/8.5.43

 

 

原因:ie中URL中有中文字符,

解决办法:请求url做下 encodeURI(url) 可以解决。

 

eg:

修改前:

var ymd = $("div[widgetname=REPORT2] tr:eq(0) td:eq(5)").text();
var y = $("div[widgetname=REPORT2] tr:eq(0) td:eq(6)").text();
var m = $("div[widgetname=REPORT2] tr:eq(0) td:eq(7)").text();
var ym = $("div[widgetname=REPORT2] tr:eq(0) td:eq(8)").text();
var title;
if (ymd == 'y') {
    title = y + "年";
} else {
    title = y + "年" + m + "月";
}

var $iframe = $("<iframe id='inp' name='inp' width='100%' height='100%' overflow-x='hidden'; scrolling='no' frameborder='0'>"); // 对话框内
// iframe 参数的命名,默认宽高占比是 100%,可向下滚动


$iframe.attr("src", "${servletURL}?viewlet=" + encodeURIComponent("大屏/大屏子报表/各公司节点完成率排名") + ".frm&ymd=" + ymd + "&y=" + y + "&m=" + m + "&ym=" + ym + "&title=" + title); // 给 iframe 添加
// src 属性
var o = {
    width: 800, //对话框宽度
    height: 600, //对话框高度
    overflow: 'auto'
};
FR.showDialog("", o.width, o.height, $iframe, o); //弹出对话框

setTimeout(function() {
    $('.fr-core-window-header')[0].style.backgroundColor = "#0a1215";
    $('.fr-core-window-body')[0].style.border = "none";
}, 100)

 

修改后:

var ymd = $("div[widgetname=REPORT2] tr:eq(0) td:eq(5)").text();
var y = $("div[widgetname=REPORT2] tr:eq(0) td:eq(6)").text();
var m = $("div[widgetname=REPORT2] tr:eq(0) td:eq(7)").text();
var ym = $("div[widgetname=REPORT2] tr:eq(0) td:eq(8)").text();
var title;
if (ymd == 'y') {
    title = y + "年";
} else {
    title = y + "年" + m + "月";
}

var $iframe = $("<iframe id='inp' name='inp' width='100%' height='100%' overflow-x='hidden'; scrolling='no' frameborder='0'>"); // 对话框内
// iframe 参数的命名,默认宽高占比是 100%,可向下滚动

var url = encodeURI("${servletURL}?viewlet=" + encodeURIComponent("大屏/大屏子报表/各公司节点完成率排名") + ".frm&ymd=" + ymd + "&y=" + y + "&m=" + m + "&ym=" + ym + "&title=" + title);
$iframe.attr("src", url); // 给 iframe 添加

// src 属性
var o = {
    width: 800, //对话框宽度
    height: 600, //对话框高度
    overflow: 'auto'
};
FR.showDialog("", o.width, o.height, $iframe, o); //弹出对话框

setTimeout(function() {
    $('.fr-core-window-header')[0].style.backgroundColor = "#0a1215";
    $('.fr-core-window-body')[0].style.border = "none";
}, 100)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值