<%@ page language="java" %>
<%@ page contentType="text/html; charset=GBK"
import="java.util.*,
smartbi.sdk.ClientConnector,
smartbi.sdk.service.user.UserManagerService"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("GBK");
// 鐢ㄦ埛鍚�
String user ="admin";
// 瀵嗙爜
String password = "admin";
// Smartbi閾炬帴
String smartbiURL = "http://localhost:18080/smartbi/vision/";
// 鍒涘缓Smartbi閾炬帴瀵硅薄
ClientConnector conn = new ClientConnector(smartbiURL);
// 寤虹珛姝よ繛鎺ユ椂锛屽氨瀵箂martbi杩涜浜嗙櫥褰�
boolean ret = conn.open(user, password);
if (!ret) {
%>
<script>
alert("鐧诲綍澶辫触!");
</script>
<%
} else {
%>
<script>
alert("鐧诲綍鎴愬姛!");
// 鑾峰彇smartbi鐨刢ookie锛屽湪闆嗘垚椤甸潰闇€瑕佷紶閫抯martbiCookie鍊硷紝浠ヤ繚璇佸墠鍚庡彴cookie鐨勪竴鑷存€�
var smartbiCookie = "<%=conn.getCookie()%>";
</script>
<%
}
%>
鍗曠偣鐧诲綍鎴愬姛
<!-- 浣跨敤iframe鐩存帴璁块棶Smartbi涓婚〉鎴栨姤琛ㄨ祫婧愬苟鍦ㄩ摼鎺ヤ笂甯︿笂smartbiCookie鍙傛暟 -->
<iframe style='width:100%;height:600px'
src='http://localhost:18080/smartbi/vision/index.jsp?smartbiCookie=<%=java.net.URLEncoder.encode(conn.getCookie()) %>'>
</iframe>
</body>
</html>