cognos退出,可以使用浏览器访问:
http://server/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/logoff.xts&h_CAM_action=logoff但是我想在java代码中,退出cognos,将这个链接作为参数,结果无法退出。
可能是cognos的cookie所致?
但是却无法在代码中获得?
下面是我写的退出代码:
HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod("
http://server/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/logoff.xts&h_CAM_action=logoff
");
try {
int statusCode = httpClient.executeMethod(getMethod);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + getMethod.getStatusLine());
}
// 读取内容
byte[] responseBody = getMethod.getResponseBody();
// 处理内容
String html = new String(responseBody);
System.out.println(html);
} catch (Exception e) {
System.err.println("页面无法访问");
}
getMethod.releaseConnection();
http://server/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/logoff.xts&h_CAM_action=logoff但是我想在java代码中,退出cognos,将这个链接作为参数,结果无法退出。
可能是cognos的cookie所致?
但是却无法在代码中获得?
下面是我写的退出代码:
HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod("
http://server/cognos8/cgi-bin/cognos.cgi?b_action=xts.run&m=portal/logoff.xts&h_CAM_action=logoff
");
try {
int statusCode = httpClient.executeMethod(getMethod);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + getMethod.getStatusLine());
}
// 读取内容
byte[] responseBody = getMethod.getResponseBody();
// 处理内容
String html = new String(responseBody);
System.out.println(html);
} catch (Exception e) {
System.err.println("页面无法访问");
}
getMethod.releaseConnection();
采用在浏览器的工具栏清楚cookie后,也是无效的。
这种cgi登录方式的退出问题,不好办
如何获得这是值,并在客户端设置呢?
,如果使用java代码的话,应该将cookie和session的去掉?
问题是如何做呢?