起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 160|回复: 8

【搞定】[请求] 从网页登陆系统如何更改题头显示内容?

[复制链接]
发表于 2008-1-2 13:43:25 | 显示全部楼层 |阅读模式
在 Business.jsp 同目录下,将business.jsp (保留用于显示原来的登陆对话框)复制为另一个jsp文件:Biz.jsp(用于从网页录入姓名、密码后登陆系统),该文件用来从门户网站上登陆系统,参考http://bbs.justep.com/forum.php?mod=viewthread&tid=18156,在Biz.jsp 内添加如下代码:
  X3X.Logon(username,pwd);
    X3X.Run("Biz:\System\Init.Func", "", "", "");

现在通过网页输入用户名、密码可以登陆系统,但是IE 题头不对,是地址栏内的文字,请问如何设置指定的题头文字?如 “X3 协同管理系统”

原来IE 题头设置在..X3 ServerTOMCATwebappsROOTindex.html 文件内,现在通过biz.jsp 登陆如何设置IE 题头?

未标题-1 拷贝.jpg

32.78 KB, 下载次数: 101

回复

使用道具 举报

发表于 2008-1-2 13:51:53 | 显示全部楼层
<%@ 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>>工作计划管理系统</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 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("", "", "", "");
  document.body.onbeforeunload=BeforeClose;
  document.title = X3X.DisplayName;
</script>

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

使用道具 举报

发表于 2008-1-2 13:52:28 | 显示全部楼层
注意document.title = X3X.DisplayName;  多加几次这句话
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-2 14:01:14 | 显示全部楼层
按照business.jsp 修改的文件,请看看哪里有错误? 在这个文件里修改<title>好像不起作用。

<%@ 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>公司办公自动化系统</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 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.Logon(username,pwd);
  X3X.Run("Biz:\\System\\Init.Func", "", "", "");

  //X3X.Run("", "", "", "");
  //document.body.onbeforeunload=BeforeClose;
  document.title = X3X.DisplayName;
</script>
<input type="hidden" value="<%=request.getParameter("username")%>">
<input type="hidden" value="<%=request.getParameter("pwd")%>">
</BODY>
</HTML>
回复 支持 反对

使用道具 举报

发表于 2008-1-2 14:43:42 | 显示全部楼层
document.title = X3X.DisplayName;
直接改为
document.title = '公司办公自动化系统';
回复 支持 反对

使用道具 举报

发表于 2008-1-2 14:57:05 | 显示全部楼层
document.title = "公司办公自动化系统";
改成定值就可以了
不要写
document.title = X3X.DisplayName;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-2 15:24:41 | 显示全部楼层
可以了,但是出现另外一个问题,用户名或密码输入错误后,IE 内是空白的,如何能在用户输入错误用户名后出现登陆对话框?类似下面的代码:

if (X3X.Logon(username,pwd) = TRUE) then
       X3X.Run("Biz:\\System\\Init.Func", "", "", "");
  else
       X3X.Run("", "", "", "");
      document.body.onbeforeunload=BeforeClose;
回复 支持 反对

使用道具 举报

发表于 2008-1-2 17:57:58 | 显示全部楼层
现在不支持,已经提交需求
回复 支持 反对

使用道具 举报

发表于 2008-1-5 10:14:09 | 显示全部楼层
7楼的问题短期内平台不太可能支持。
楼主可以参考 http://bbs.justep.com/forum.php? ... p;highlight=x3x.ocx
的方法自己来写一个方法返回false true.
如果处理中遇到问题请开新贴,这个贴先结了
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-4 17:57 , Processed in 0.046070 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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