version fix
This commit is contained in:
@@ -30,7 +30,7 @@ public class InitApplicationContext extends HttpServlet {
|
|||||||
private static final Logger _logger = LoggerFactory.getLogger(InitApplicationContext.class);
|
private static final Logger _logger = LoggerFactory.getLogger(InitApplicationContext.class);
|
||||||
private static final long serialVersionUID = -797399138268601444L;
|
private static final long serialVersionUID = -797399138268601444L;
|
||||||
ApplicationContext applicationContext;
|
ApplicationContext applicationContext;
|
||||||
Properties properties;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getServletInfo() {
|
public String getServletInfo() {
|
||||||
@@ -146,11 +146,11 @@ public class InitApplicationContext extends HttpServlet {
|
|||||||
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer =
|
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer =
|
||||||
((PropertySourcesPlaceholderConfigurer) applicationContext
|
((PropertySourcesPlaceholderConfigurer) applicationContext
|
||||||
.getBean("propertySourcesPlaceholderConfigurer"));
|
.getBean("propertySourcesPlaceholderConfigurer"));
|
||||||
properties = (Properties) propertySourcesPlaceholderConfigurer
|
WebContext.properties = (Properties) propertySourcesPlaceholderConfigurer
|
||||||
.getAppliedPropertySources()
|
.getAppliedPropertySources()
|
||||||
.get(PropertySourcesPlaceholderConfigurer.LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME)
|
.get(PropertySourcesPlaceholderConfigurer.LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME)
|
||||||
.getSource();
|
.getSource();
|
||||||
Set<Object> keyValue = properties.keySet();
|
Set<Object> keyValue = WebContext.properties.keySet();
|
||||||
SortedSet<String> keyValueSet = new TreeSet<String>();
|
SortedSet<String> keyValueSet = new TreeSet<String>();
|
||||||
// sort key
|
// sort key
|
||||||
for (Iterator<Object> it = keyValue.iterator(); it.hasNext();) {
|
for (Iterator<Object> it = keyValue.iterator(); it.hasNext();) {
|
||||||
@@ -160,7 +160,7 @@ public class InitApplicationContext extends HttpServlet {
|
|||||||
// out
|
// out
|
||||||
for (Iterator<String> it = keyValueSet.iterator(); it.hasNext();) {
|
for (Iterator<String> it = keyValueSet.iterator(); it.hasNext();) {
|
||||||
String key = (String) it.next();
|
String key = (String) it.next();
|
||||||
_logger.trace(key + " = " + properties.get(key));
|
_logger.trace(key + " = " + WebContext.properties.get(key));
|
||||||
}
|
}
|
||||||
_logger.trace("-----------------------------------------------------------");
|
_logger.trace("-----------------------------------------------------------");
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ public class InitApplicationContext extends HttpServlet {
|
|||||||
_logger.info("+ MaxKey ");
|
_logger.info("+ MaxKey ");
|
||||||
_logger.info("+ Single Sign On ( SSO ) ");
|
_logger.info("+ Single Sign On ( SSO ) ");
|
||||||
_logger.info("+ Version "
|
_logger.info("+ Version "
|
||||||
+ properties.getProperty("application.formatted-version"));
|
+ WebContext.properties.getProperty("application.formatted-version"));
|
||||||
_logger.info("+");
|
_logger.info("+");
|
||||||
_logger.info("+ https://www.maxkey.top/");
|
_logger.info("+ https://www.maxkey.top/");
|
||||||
_logger.info("+ email:shimingxy@163.com");
|
_logger.info("+ email:shimingxy@163.com");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.maxkey.web;
|
package org.maxkey.web;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Properties;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
@@ -29,6 +30,8 @@ import org.springframework.web.servlet.support.RequestContextUtils;
|
|||||||
*/
|
*/
|
||||||
public final class WebContext {
|
public final class WebContext {
|
||||||
|
|
||||||
|
public static Properties properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set Current login user to session.
|
* set Current login user to session.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import java.io.IOException;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.maxkey.web.WebContext;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -34,21 +36,25 @@ public class LocaleTagDirective implements TemplateDirectiveModel {
|
|||||||
throws TemplateException, IOException {
|
throws TemplateException, IOException {
|
||||||
WebApplicationContext webApplicationContext =
|
WebApplicationContext webApplicationContext =
|
||||||
RequestContextUtils.findWebApplicationContext(request);
|
RequestContextUtils.findWebApplicationContext(request);
|
||||||
|
String message = "";
|
||||||
if (params.get("code") == null) {
|
if (params.get("code") == null) {
|
||||||
env.getOut().append(RequestContextUtils.getLocale(request).getLanguage());
|
message = RequestContextUtils.getLocale(request).getLanguage();
|
||||||
|
} else if (params.get("code").toString().equals("global.application.version")
|
||||||
|
|| params.get("code").toString().equals("application.version")) {
|
||||||
|
message = WebContext.properties.getProperty("application.formatted-version");
|
||||||
} else {
|
} else {
|
||||||
_logger.trace("message code " + params.get("code"));
|
_logger.trace("message code " + params.get("code"));
|
||||||
try {
|
try {
|
||||||
env.getOut().append(
|
message = webApplicationContext.getMessage(
|
||||||
webApplicationContext.getMessage(
|
|
||||||
params.get("code").toString(),
|
params.get("code").toString(),
|
||||||
null,
|
null,
|
||||||
RequestContextUtils.getLocale(request)));
|
RequestContextUtils.getLocale(request));
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
_logger.error("message code " + params.get("code"), e);
|
_logger.error("message code " + params.get("code"), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
env.getOut().append(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ server.port=9521
|
|||||||
server.servlet.context-path=/maxkey-mgt
|
server.servlet.context-path=/maxkey-mgt
|
||||||
|
|
||||||
application.name=MaxKey-Mgt
|
application.name=MaxKey-Mgt
|
||||||
#message.properties global.application.version is need to update
|
|
||||||
application.formatted-version=v1.4.0 GA
|
application.formatted-version=v1.4.0 GA
|
||||||
|
|
||||||
#for freemarker
|
#for freemarker
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
global.application=MaxKey\u5E94\u7528\u5B89\u5168\u7BA1\u7406\u7CFB\u7EDF
|
global.application=MaxKey\u5E94\u7528\u5B89\u5168\u7BA1\u7406\u7CFB\u7EDF
|
||||||
global.application.version=v1.3.0 GA
|
|
||||||
global.change.language=\u8BED\u97F3\u9009\u62E9
|
global.change.language=\u8BED\u97F3\u9009\u62E9
|
||||||
global.change.language.en=English
|
global.change.language.en=English
|
||||||
global.change.language.zh=\u4E2D\u6587
|
global.change.language.zh=\u4E2D\u6587
|
||||||
@@ -386,6 +385,10 @@ apps.oauth.connect.userInfoEncryptionMethod=\u7528\u6237\u52A0\u5BC6\u65B9\u6CD5
|
|||||||
group.id=\u7EC4\u7F16\u7801
|
group.id=\u7EC4\u7F16\u7801
|
||||||
group.name=\u7528\u6237\u7EC4
|
group.name=\u7528\u6237\u7EC4
|
||||||
|
|
||||||
|
#role
|
||||||
|
role.id=\u89D2\u8272\u7F16\u7801
|
||||||
|
role.name=\u89D2\u8272
|
||||||
|
|
||||||
#account
|
#account
|
||||||
account.username=\u7528\u6237\u540D
|
account.username=\u7528\u6237\u540D
|
||||||
account.displayName=\u7528\u6237\u59D3\u540D
|
account.displayName=\u7528\u6237\u59D3\u540D
|
||||||
@@ -465,3 +468,4 @@ navs.audit=\u65E5\u5FD7\u5BA1\u8BA1
|
|||||||
navs.audit.login=\u767B\u5F55\u65E5\u5FD7
|
navs.audit.login=\u767B\u5F55\u65E5\u5FD7
|
||||||
navs.audit.loginapps=\u8BBF\u95EE\u65E5\u5FD7
|
navs.audit.loginapps=\u8BBF\u95EE\u65E5\u5FD7
|
||||||
navs.audit.operate=\u64CD\u4F5C\u65E5\u5FD7
|
navs.audit.operate=\u64CD\u4F5C\u65E5\u5FD7
|
||||||
|
navs.roles=\u89D2\u8272\u7BA1\u7406
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
global.application=MaxKey Secure Management
|
global.application=MaxKey Secure Management
|
||||||
global.application.version=v1.3.0 GA
|
|
||||||
global.change.language=Language
|
global.change.language=Language
|
||||||
global.change.language.en=English
|
global.change.language.en=English
|
||||||
global.change.language.zh=\u4E2D\u6587
|
global.change.language.zh=\u4E2D\u6587
|
||||||
@@ -385,6 +384,10 @@ apps.oauth.connect.userInfoEncryptionMethod=idTokenEncryptionMethod
|
|||||||
group.id=id
|
group.id=id
|
||||||
group.name=name
|
group.name=name
|
||||||
|
|
||||||
|
#role
|
||||||
|
role.id=id
|
||||||
|
role.name=name
|
||||||
|
|
||||||
#account
|
#account
|
||||||
account.username=username
|
account.username=username
|
||||||
account.displayName=displayName
|
account.displayName=displayName
|
||||||
@@ -465,3 +468,4 @@ navs.audit=Audit
|
|||||||
navs.audit.login=Login
|
navs.audit.login=Login
|
||||||
navs.audit.loginapps=LoginApps
|
navs.audit.loginapps=LoginApps
|
||||||
navs.audit.operate=Operate
|
navs.audit.operate=Operate
|
||||||
|
navs.roles=Roles
|
||||||
@@ -20,6 +20,12 @@
|
|||||||
<input type="text" id="name" name="name" class="form-control" title="" value="" required="" />
|
<input type="text" id="name" name="name" class="form-control" title="" value="" required="" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><@locale code="common.text.description" />:</th>
|
||||||
|
<td nowrap>
|
||||||
|
<input type="text" id="description" name="description" class="form-control" title="" value="" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td nowrap colspan="2" class="center">
|
<td nowrap colspan="2" class="center">
|
||||||
<input id="_method" type="hidden" name="_method" value="post"/>
|
<input id="_method" type="hidden" name="_method" value="post"/>
|
||||||
|
|||||||
@@ -26,6 +26,12 @@
|
|||||||
<input type="text" id="name" name="name" class="form-control" title="" value="${model.name}" required="" />
|
<input type="text" id="name" name="name" class="form-control" title="" value="${model.name}" required="" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><@locale code="common.text.description" />:</th>
|
||||||
|
<td nowrap>
|
||||||
|
<input type="text" id="description" name="description" class="form-control" title="" value="${model.description!}" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td nowrap colspan="2" class="center">
|
<td nowrap colspan="2" class="center">
|
||||||
<input id="_method" type="hidden" name="_method" value="post"/>
|
<input id="_method" type="hidden" name="_method" value="post"/>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ server.ssl.key-store-type=JKS
|
|||||||
server.servlet.context-path=/maxkey
|
server.servlet.context-path=/maxkey
|
||||||
|
|
||||||
application.name=MaxKey
|
application.name=MaxKey
|
||||||
#message.properties global.application.version is need to update
|
|
||||||
application.formatted-version=v1.4.0 GA
|
application.formatted-version=v1.4.0 GA
|
||||||
|
|
||||||
#for freemarker
|
#for freemarker
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
global.application=MaxKey\u5E94\u7528\u5B89\u5168\u7CFB\u7EDF
|
global.application=MaxKey\u5E94\u7528\u5B89\u5168\u7CFB\u7EDF
|
||||||
global.application.version=v1.3.0 GA
|
|
||||||
global.change.language=\u8BED\u97F3\u9009\u62E9
|
global.change.language=\u8BED\u97F3\u9009\u62E9
|
||||||
global.change.language.en=English
|
global.change.language.en=English
|
||||||
global.change.language.zh=\u4E2D\u6587
|
global.change.language.zh=\u4E2D\u6587
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
global.application=MaxKey Secure Sign-on System
|
global.application=MaxKey Secure Sign-on System
|
||||||
global.application.version=v1.3.0 GA
|
|
||||||
global.change.language=Language
|
global.change.language=Language
|
||||||
global.change.language.en=English
|
global.change.language.en=English
|
||||||
global.change.language.zh=\u4E2D\u6587
|
global.change.language.zh=\u4E2D\u6587
|
||||||
|
|||||||
Reference in New Issue
Block a user