Index: forgon-tools/src/main/java/com/forgon/tools/util/PropertiesUtils.java =================================================================== diff -u -r24386 -r29367 --- forgon-tools/src/main/java/com/forgon/tools/util/PropertiesUtils.java (.../PropertiesUtils.java) (revision 24386) +++ forgon-tools/src/main/java/com/forgon/tools/util/PropertiesUtils.java (.../PropertiesUtils.java) (revision 29367) @@ -43,6 +43,49 @@ } } + if (in == null){ + logger.warn("属性文件'" + propFileName + "'在指定的路径中未找到!"); + } + + return getPropertyValue(propertyName, in); + } + + /** + * 或者version.properties文件中的属性 + * version.properties文件位于ROOT文件夹的根目录中 + * @param propertyName 属性名称 + * @return 属性值的字符串 + */ + public static String getVersionProperty(String propertyName) { + String propFileName = "version.properties"; + + InputStream in = null; + try { + String webAppRoot = PathUtils.getWebAppRootPath(); + + String propFilePath = webAppRoot + "/" + propFileName; + File propFile = new File(propFilePath); + in = new FileInputStream(propFile); + } catch (IOException e) { + e.printStackTrace(); + } + + if (in == null){ + logger.warn("属性文件'" + propFileName + "'在指定的路径中未找到!"); + } + + return getPropertyValue(propertyName, in); + } + + /** + * 获取属性文件中的属性的值 + * @param propertyName 属性名称 + * @param propFileName 属性文件名称 + * @param in 属性文件的输入流 + * @return 属性值的字符串 + */ + public static String getPropertyValue(String propertyName, + InputStream in) { String value = "defaults"; if (in != null){ @@ -59,9 +102,7 @@ e.printStackTrace(); } } - else{ - logger.warn("属性文件'" + propFileName + "'在类路径中未找到!"); - } + if (prop != null){ value = prop.getProperty(propertyName); Index: ssts-web/src/main/webapp/systemmanage/system/systemInfo.js =================================================================== diff -u -r23644 -r29367 --- ssts-web/src/main/webapp/systemmanage/system/systemInfo.js (.../systemInfo.js) (revision 23644) +++ ssts-web/src/main/webapp/systemmanage/system/systemInfo.js (.../systemInfo.js) (revision 29367) @@ -149,6 +149,48 @@ cls:'fieldReadOnlyNoRemove', anchor : '100%' }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', + fieldLabel : "版本号", + id : "globalVersion", + name : "globalVersion", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', + fieldLabel : "svn版本号", + id : "svnRevision", + name : "svnRevision", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 80, + labelAlign:"right", + items:[{ + xtype : 'textfield', + fieldLabel : "构建时间", + id : "buildDateTime", + name : "buildDateTime", + readOnly : true, + cls:'fieldReadOnlyNoRemove', + anchor : '100%' + }] }] }); Index: ssts-web/src/main/webapp/systemmanage/system/systemInfo.jsp =================================================================== diff -u -r23630 -r29367 --- ssts-web/src/main/webapp/systemmanage/system/systemInfo.jsp (.../systemInfo.jsp) (revision 23630) +++ ssts-web/src/main/webapp/systemmanage/system/systemInfo.jsp (.../systemInfo.jsp) (revision 29367) @@ -9,7 +9,7 @@ -打印调试 +系统信息