jnlpParam.jsp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <%@ page import="com.kingdee.eas.cp.common.web.config.PortalXmlConfiguration"%>
  2. <%@ page import="com.kingdee.eas.portal.web.configuration.PortalConfig,
  3. com.kingdee.util.XMLConfiguration,
  4. com.kingdee.util.ConfigurationItem"%>
  5. <%
  6. try
  7. {
  8. String _jnlpParam_serverName = request.getServerName();
  9. if(_jnlpParam_serverName == null || "".equals(_jnlpParam_serverName) )
  10. {
  11. _jnlpParam_serverName = "localhost";
  12. }
  13. String _jnlpParam_serverPort = Integer.toString(request.getServerPort());
  14. if(_jnlpParam_serverPort == null || "".equals(_jnlpParam_serverPort) )
  15. {
  16. _jnlpParam_serverPort = "6888";
  17. }
  18. //web.xml config initparameter
  19. //String _jnlpWebSite = getServletConfig().getServletContext().getInitParameter("com.kingdee.eas.easAppletFramework.website") ;
  20. String _jnlpWebSite = PortalXmlConfiguration.getInstance().getEasWebClientConfigItem().getUrl() ;
  21. //if don't set in web.xml,set the same value as self jsp
  22. if(_jnlpWebSite == null || "".equals(_jnlpWebSite))
  23. {
  24. _jnlpWebSite = "http://" + _jnlpParam_serverName + ":" + _jnlpParam_serverPort ;
  25. }
  26. //String _jnlpPath = getServletConfig().getServletContext().getInitParameter("com.kingdee.eas.easAppletFramework.appletParameter.jnlpURL") ;
  27. String _jnlpPath = PortalXmlConfiguration.getInstance().getEasWebClientConfigItem().getJnlpUrl() ;
  28. //if don't set in web.xml,set default value
  29. if(_jnlpPath == null || "".equals(_jnlpPath))
  30. {
  31. _jnlpPath = "/easupdater/eas.jnlp" ;
  32. }
  33. String autoDownload = (String)session.getAttribute("autoDownload");
  34. if(autoDownload!=null && "true".equalsIgnoreCase(autoDownload)){
  35. autoDownload = "autoDownload=true";
  36. }else{
  37. autoDownload = "autoDownload=false";
  38. }
  39. if(_jnlpPath.indexOf("?")>-1){
  40. _jnlpPath = _jnlpPath + "&"+autoDownload;
  41. }else{
  42. _jnlpPath = _jnlpPath + "?"+autoDownload;
  43. }
  44. String _jnlpURL = _jnlpWebSite + _jnlpPath ;
  45. String _versionURL = _jnlpWebSite + "/easupdater/version.properties" ;
  46. //String _jnlpParamLocalDir = getServletConfig().getServletContext().getInitParameter("com.kingdee.eas.easAppletFramework.appletParameter.localDir") ;
  47. String _jnlpParamLocalDir = PortalXmlConfiguration.getInstance().getEasWebClientConfigItem().getLocalInstallDir() ;
  48. if(_jnlpParamLocalDir == null || "".equals(_jnlpParamLocalDir) )
  49. {
  50. _jnlpParamLocalDir = "c:\\kingdee\\eas4.1portal" ;
  51. }
  52. //append server IP
  53. _jnlpParamLocalDir = _jnlpParamLocalDir + "_" + _jnlpParam_serverName +"\\" ;
  54. ConfigurationItem configItem = PortalConfig.getConfiguration().getConfigItem("fileUpdate");
  55. String onceDownKBytes = configItem.getProperty("onceDownKBytes");
  56. String downloadMethod = configItem.getProperty("netFox");
  57. String totalTryCount = configItem.getProperty("totalTryCount");
  58. configItem = PortalConfig.getConfiguration().getConfigItem("debug");
  59. String debug = configItem.getProperty("debug");
  60. String easclienthome = configItem.getProperty("easclienthome");
  61. String metadatapath = configItem.getProperty("metadatapath");
  62. %>
  63. <PARAM name="jnlpURL" value="<%=_jnlpURL%>">
  64. <PARAM name="localDir" value="<%=_jnlpParamLocalDir%>">
  65. <PARAM name="versionURL" value="<%=_versionURL%>">
  66. <PARAM NAME = "onceDownKBytes" VALUE = "<%=onceDownKBytes%>">
  67. <PARAM NAME = "totalTryCount" VALUE = "<%=totalTryCount%>">
  68. <PARAM NAME = "downloadMethod" VALUE = "<%=downloadMethod%>">
  69. <PARAM NAME = "debug" VALUE = "<%=debug%>">
  70. <PARAM NAME = "easclienthome" VALUE = "<%=easclienthome%>">
  71. <PARAM NAME = "metadatapath" VALUE = "<%=metadatapath%>">
  72. <%
  73. }
  74. catch(Exception e)
  75. {
  76. System.err.println("[EAS Portal] set applet jnlp param fail.");
  77. }
  78. %>