起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 270|回复: 10

【结贴】如何取Parameters 得到jsp传递过来的 ie连接地址值

[复制链接]
发表于 2008-4-13 10:49:17 | 显示全部楼层 |阅读模式
在IE地址栏输入HTTP://10。1。56。80:8088 后执行,出现错误信息,怎么处理错误?

a.gif

7.05 KB, 下载次数: 109

回复

使用道具 举报

发表于 2008-4-14 08:50:24 | 显示全部楼层
楼主怎么写的jsp程序
回复 支持 反对

使用道具 举报

发表于 2008-4-14 16:26:07 | 显示全部楼层
document.title = X3X.DisplayName;
  X3X.ServerURL = "<%= url%>"
  X3X.ShowSplash();
  X3X.UpdateVersion();
  X3X.Init();
  X3X.CloseSplash();
  X3X.Run("", location.href, "", "");
  document.body.onbeforeunload=BeforeClose;
  document.title = X3X.DisplayName;
回复 支持 反对

使用道具 举报

发表于 2008-4-14 16:27:07 | 显示全部楼层
<%@ 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[]{});

String classId = (String)getBXClassIDMethod.invoke(pobj,new Object[]{});
String codeBase = (String)getBXCodeMethod.invoke(pobj,new Object[]{});
String url = (String)getSysServerURLMethod.invoke(pobj,new Object[]{});
%>
<HTML>
<HEAD>
<title>X3 协同管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>

<BODY leftmargin="0" topmargin="0" scroll="no">

<OBJECT  id = "X3X"
          classid="<%= classId%>"
          codebase="<%= codeBase%>"
          width="100%"
          height="100%"
          align=center
          hspace=0
          vspace=0
>
</OBJECT>

<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object>

<script ID="BusinessCloseEventHandler" language="javascript" FOR="X3X" EVENT="OnTerminate">
  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 type="text/javascript">
  function BeforeClose()
  {
    if(!X3X.TerminateQuery())
    {
      event.returnValue = "";
    }
  }

  document.title = X3X.DisplayName;
  X3X.ServerURL = "<%= url%>"
  X3X.ShowSplash();
  X3X.UpdateVersion();
  X3X.Init();
  X3X.CloseSplash();
  X3X.Run("", location.href, "", "");
  document.body.onbeforeunload=BeforeClose;
  document.title = X3X.DisplayName;
</script>

</BODY>
</HTML>
回复 支持 反对

使用道具 举报

发表于 2008-4-14 17:59:56 | 显示全部楼层
楼主的jsp文件没有问题,
我实验了,可以在TInit功能中获得传入的ip地址。

楼主现在有什么问题?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-14 21:00:21 | 显示全部楼层
在系统初始化增加一行代码:jsDialogs.ShowMsg(Parameters, 'http://10.1.56.81:8088/?');
在编译后再在IE地址输入 http://10.1.56.80:8088 。然后弹出一对话框显示为:
http://10.1.56.80:8088/X3/Business.jsp 内容。请问在那出问题了?
回复 支持 反对

使用道具 举报

发表于 2008-4-15 08:44:02 | 显示全部楼层
location.href   本来输出的就是这个吧 http://10.1.56.80:8088/X3/Business.jsp
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-15 08:53:55 | 显示全部楼层
我说的意思是location.href 参数可以传递IE地址值,但是后面带/X3/Business.jsp是否正确?
回复 支持 反对

使用道具 举报

发表于 2008-4-15 09:06:16 | 显示全部楼层
楼主,这个内容是正确的。

需要你自己解析一下这个字符串,取出10.1.56.80这个地址,然后做判断就可以了。
回复 支持 反对

使用道具 举报

发表于 2008-4-15 09:11:00 | 显示全部楼层
<script type="text/javascript">
  function BeforeClose()
  {
    if(!X3X.TerminateQuery())
    {
      event.returnValue = "";
    }
  }
   alert(location.href);
  document.title = X3X.DisplayName;
  X3X.ServerURL = "<%= url%>"
  X3X.ShowSplash();
  X3X.UpdateVersion();
  X3X.Init();
  X3X.CloseSplash();
  X3X.Run("", location.href, "", "");
  document.body.onbeforeunload=BeforeClose;//location.href
  document.title = X3X.DisplayName;
</script>
---------------------------------------------------------------------
   alert(location.href);

我用这个验证,平台里面和ie获得的值一样的。也是http://*****X3/Business.jsp
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-10 17:38 , Processed in 0.044123 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表