|

楼主 |
发表于 2009-6-9 09:02:26
|
显示全部楼层
哦,是我没有说清楚,我修改了login.html和Business.jsp,
loginFWCX1.html的源码如下:
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>
<script language="javascript" src="mycookie.js"/></script>
<BODY topmargin="0">
正在连接到Justep X3 Web Server...
<script language="JavaScript" type="text/JavaScript">
//***********************
if (get_cookie('opened')!=''){
window.top.close();
} else{
document.cookie="opened=yes";//加上cookie
window.location.href="BusinessFWCX1.jsp?username=chenping&pwd=";
}
//***********************
</script>
</BODY>
</HTML>
BusinessFWCX1.jsp的源码如下所示:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.justep.loader.LibContext"%>
<%@ page import="java.lang.reflect.Method" %>
<%
Class pclass = LibContext.getInstance().getLoader().loadClass("com.justep.web.SysServerProvider");
Object pobj = pclass.newInstance();
Method getBXClassIDMethod = pclass.getMethod("getBXClassID",new Class[]{});
Method getBXCodeMethod = pclass.getMethod("getBXCodebase",new Class[]{});
Method getSysServerURLMethod = pclass.getMethod("getSysServerURL",new Class[]{});
Method getClientPathMethod = pclass.getMethod("getClientPath",new Class[]{});
Method getVersionMethod = pclass.getMethod("getVersion",new Class[]{});
Method getVersionKeyMethod = pclass.getMethod("getVersionKey",new Class[]{});
Method getVersionHashMethod = pclass.getMethod("getVersionHash",new Class[]{});
String classId = (String)getBXClassIDMethod.invoke(pobj,new Object[]{});
String codeBase = (String)getBXCodeMethod.invoke(pobj,new Object[]{});
String url = (String)getSysServerURLMethod.invoke(pobj,new Object[]{});
String clientPath = (String)getClientPathMethod.invoke(pobj,new Object[]{});
String version = (String)getVersionMethod.invoke(pobj,new Object[]{});
String versionKey = (String)getVersionKeyMethod.invoke(pobj,new Object[]{});
String versionHash = (String)getVersionHashMethod.invoke(pobj,new Object[]{});
String params = " -s" + url;
if (clientPath != null && !"".equals(clientPath))
params = params + " -p" + clientPath;
if (version != null && !"".equals(version))
params = params + " -vid" + version;
if (versionKey != null && !"".equals(versionKey))
params = params + " -vk" + versionKey;
if (versionHash != null && !"".equals(versionHash))
params = params + " -vh" + versionHash;
%>
<%//通过request获取登录帐号、密码
String username = request.getParameter("username");
String pwd = request.getParameter("pwd");
if(username.contains("\'")) {
username = username.substring(username.indexOf("\'")+1,username.lastIndexOf("\'"));
}
if(username.contains("\"")) {
username = username.substring(username.indexOf("\"")+1,username.lastIndexOf("\""));
}
if(pwd.contains("\'")) {
pwd = pwd.substring(pwd.indexOf("\'")+1,pwd.lastIndexOf("\'"));
}
if(pwd.contains("\"")) {
pwd = pwd.substring(pwd.indexOf("\"")+1,pwd.lastIndexOf("\""));
}
%>
<HTML>
<HEAD>
<title>X3 协同管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="Scripts/AC_ActiveX.js" type="text/javascript"></script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</HEAD>
<BODY leftmargin="0" topmargin="0" scroll="no">
<script type="text/javascript">
AC_AX_RunContent("id", "X3X", "classid", "<%= classId%>", "codebase", "<%= codeBase%>", "width", "100%", "height", "100%", "align", "center", "hspace", "0", "vspace", "0");
</script>
<noscript><OBJECT id = "X3X"
classid="<%= classId%>"
codebase="<%= codeBase%>"
width="100%"
height="100%"
align=center
hspace=0
vspace=0
>
</OBJECT></noscript>
<script type="text/javascript">
AC_AX_RunContent("id", "WebBrowser", "width", "0", "height", "0", "classid", "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2");
</script>
<noscript><object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object></noscript>
<script ID="BusinessCloseEventHandler" language="javascript" FOR="X3X" EVENT="OnTerminate">
top.window.opener=null;
top.window.close();
//WebBrowser.ExecWB(45,1); // close window
</script>
<script ID="RTEventHandler" language="javascript" FOR="X3X" EVENT="OnRTEvent(Param)">
//X3脚本事件
//可以在脚本中执行RTEvent.Execute('Param1');最终调用会执行到这里,Param1的内容格式可以自定义
//Param变量的内容就是传出的字符串(Param1)。
</script>
<script language="javascript" src="mycookie.js"/></script>
<script type="text/javascript">
function BeforeClose()
{
if(!X3X.TerminateQuery())
{
delCookie('opened');//****************************
event.returnValue = "";
}
}
document.title = X3X.DisplayName;
X3X.Params = "<%= params%>";
X3X.UpdateVersion();
// X3X.ShowSplash();
X3X.Init();
// X3X.CloseSplash();
// X3X.Run("", "", "", "");
X3X.Logon("<%=username%>","<%=pwd%>"); //自动登录
X3X.Run("Biz:\\System\\Init.Func", "Biz:\\FWT\\FUNC\\FWCX.Func", "", ""); //必须要传入参数系统初始化功能
document.body.onbeforeunload=BeforeClose;
document.title = X3X.DisplayName;
</script>
</BODY>
</HTML>
现在这种状态,还是14楼上所描述的效果那样,
是我的代码有问题,还是效果就应该如此呢? |
|