servlet报错:
java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/fuNan_conv/...
查看api,
static int SC_HTTP_VERSION_NOT_SUPPORTED
Status code (505) indicating that the server does not support or refuses to support the HTTP protocol version that was used in the request message.状态代码(505)表明该服务器不支持或不支持HTTP协议的版本中使用了请求消息。
很明显了,请求的url的格式不对,
看下自己的代码:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%
String dateBegin=request.getParameter("dateBegin");
String dateEnd=request.getParameter("dateEnd");
String deptId=request.getParameter("deptId");
String convId = request.getParameter("convId");
String spId = request.getParameter("spId");
if(deptId==null||deptId.equals("")){
deptId="0";
}
String servType = request.getParameter("servType");
String reportFile = "/report/iReport/banjiantongjiHZ.jasper";//"/report/iReport/banjiantongji.jasper";
String params = "&dateBegin="+dateBegin+"&dateEnd="+dateEnd+"&reportFile="+ reportFile+"&convId="+convId+"&spId="+spId;//modify by mfan 2006-12-29
out.println("params="+params);
%>
我试着不传递参数,没有问题了,程序正常,报表也正常。
通过:out.println("params="+params);输出请求的参数,呵呵,字符串还是清楚下前部空白和尾部空白。trim()下,ok!
修改后的代码:
<%
String dateBegin=request.getParameter("dateBegin");
if(!"".equals(dateBegin) && null !=dateBegin) dateBegin.trim();
String dateEnd=request.getParameter("dateEnd").trim();
if(!"".equals(dateEnd) && null !=dateEnd ) dateEnd.trim();
String deptId=request.getParameter("deptId");
if(!"".equals(deptId) && null !=deptId ) deptId.trim();
String convId = request.getParameter("convId");
if(!"".equals(convId) && null !=convId ) convId.trim();
String spId = request.getParameter("spId");
if(!"".equals(spId) && null !=spId ) spId.trim();
String servType = request.getParameter("servType");
String reportFile = "/report/iReport/banjiantongjiHZ.jasper";//"/report/iReport/banjiantongji.jasper";
String params = "&dateBegin="+dateBegin+"&dateEnd="+dateEnd+"&reportFile="+ reportFile+"&convId="+convId+"&spId="+spId;//modify by mfan 2006-12-29
out.println("params="+params);
%>
分享到:
相关推荐
java.io.IOException: Server returned HTTP response code: 403 for URL 处理过程记录 BASIC AUTH2 POST接口,解决403问题
声明 1、本解决方法适用于浏览器正常访问,但是代码请求报错Http 403错误的场景; 概述: 1、Http 403报错是常见的网络错误提示,表示...报错Server returned HTTP response code 403 for URL.txt》里面的内容操作。
429问题处理办法(悟用书生)
m3u8是一种媒体播放列表格式,它包含...5.2、解决报错:Server returned HTTP response code: 403 for URL。 若下载下来有合并需求的,可以看下合并工具:https://download.csdn.net/download/gongjin28_csdn/35906117
如果在部署时出现 `Server returned HTTP response code: 403` 异常,可能是因为 Tomcat 7 引用的角色是 `manager-script` 而不是 `manager`,或者 Tomcat 7 对于部署(deploy)需要的角色应该是 `manager-script` ...
if (info.indexOf("Server returned HTTP response code: 500 for URL") != -1) { success = true; } else { success = false; } } ``` 这部分代码负责处理在尝试连接和读取URL数据过程中可能遇到的各种异常。...
- The `StatusCode` property provides access to the HTTP status code returned by the server. ### Usage Examples #### Basic Usage ```csharp HttpProc.WebClient client = new HttpProc.WebClient(); ...
url_rewriter.tags ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" ; Production Value: "a=href,area=href,frame=...
- **4.2.3** `UPnPEventType`: Defines the reason code for an event callback. - **4.2.5** `UpnpSType`: Represents the different types of searches that can be performed using the SDK for UPnP Devices API...