version fix

上级 78354ff4
......@@ -30,7 +30,7 @@ public class InitApplicationContext extends HttpServlet {
private static final Logger _logger = LoggerFactory.getLogger(InitApplicationContext.class);
private static final long serialVersionUID = -797399138268601444L;
ApplicationContext applicationContext;
Properties properties;
@Override
public String getServletInfo() {
......@@ -146,11 +146,11 @@ public class InitApplicationContext extends HttpServlet {
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer =
((PropertySourcesPlaceholderConfigurer) applicationContext
.getBean("propertySourcesPlaceholderConfigurer"));
properties = (Properties) propertySourcesPlaceholderConfigurer
WebContext.properties = (Properties) propertySourcesPlaceholderConfigurer
.getAppliedPropertySources()
.get(PropertySourcesPlaceholderConfigurer.LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME)
.getSource();
Set<Object> keyValue = properties.keySet();
Set<Object> keyValue = WebContext.properties.keySet();
SortedSet<String> keyValueSet = new TreeSet<String>();
// sort key
for (Iterator<Object> it = keyValue.iterator(); it.hasNext();) {
......@@ -160,7 +160,7 @@ public class InitApplicationContext extends HttpServlet {
// out
for (Iterator<String> it = keyValueSet.iterator(); it.hasNext();) {
String key = (String) it.next();
_logger.trace(key + " = " + properties.get(key));
_logger.trace(key + " = " + WebContext.properties.get(key));
}
_logger.trace("-----------------------------------------------------------");
}
......@@ -195,7 +195,7 @@ public class InitApplicationContext extends HttpServlet {
_logger.info("+ MaxKey ");
_logger.info("+ Single Sign On ( SSO ) ");
_logger.info("+ Version "
+ properties.getProperty("application.formatted-version"));
+ WebContext.properties.getProperty("application.formatted-version"));
_logger.info("+");
_logger.info("+ https://www.maxkey.top/");
_logger.info("+ email:shimingxy@163.com");
......
package org.maxkey.web;
import java.util.Locale;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.LogFactory;
......@@ -29,6 +30,8 @@ import org.springframework.web.servlet.support.RequestContextUtils;
*/
public final class WebContext {
public static Properties properties;
/**
* set Current login user to session.
*
......
......@@ -4,6 +4,8 @@ import java.io.IOException;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.maxkey.web.WebContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -34,21 +36,25 @@ public class LocaleTagDirective implements TemplateDirectiveModel {
throws TemplateException, IOException {
WebApplicationContext webApplicationContext =
RequestContextUtils.findWebApplicationContext(request);
String message = "";
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 {
_logger.trace("message code " + params.get("code"));
try {
env.getOut().append(
webApplicationContext.getMessage(
message = webApplicationContext.getMessage(
params.get("code").toString(),
null,
RequestContextUtils.getLocale(request)));
RequestContextUtils.getLocale(request));
} catch (Exception 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
application.name=MaxKey-Mgt
#message.properties global.application.version is need to update
application.formatted-version=v1.4.0 GA
#for freemarker
......
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.en=English
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.name=\u7528\u6237\u7EC4
#role
role.id=\u89D2\u8272\u7F16\u7801
role.name=\u89D2\u8272
#account
account.username=\u7528\u6237\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.loginapps=\u8BBF\u95EE\u65E5\u5FD7
navs.audit.operate=\u64CD\u4F5C\u65E5\u5FD7
navs.roles=\u89D2\u8272\u7BA1\u7406
global.application=MaxKey Secure Management
global.application.version=v1.3.0 GA
global.change.language=Language
global.change.language.en=English
global.change.language.zh=\u4E2D\u6587
......@@ -385,6 +384,10 @@ apps.oauth.connect.userInfoEncryptionMethod=idTokenEncryptionMethod
group.id=id
group.name=name
#role
role.id=id
role.name=name
#account
account.username=username
account.displayName=displayName
......@@ -465,3 +468,4 @@ navs.audit=Audit
navs.audit.login=Login
navs.audit.loginapps=LoginApps
navs.audit.operate=Operate
navs.roles=Roles
\ No newline at end of file
......@@ -20,6 +20,12 @@
<input type="text" id="name" name="name" class="form-control" title="" value="" required="" />
</td>
</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>
<td nowrap colspan="2" class="center">
<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="" />
</td>
</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>
<td nowrap colspan="2" class="center">
<input id="_method" type="hidden" name="_method" value="post"/>
......
......@@ -14,7 +14,6 @@ server.ssl.key-store-type=JKS
server.servlet.context-path=/maxkey
application.name=MaxKey
#message.properties global.application.version is need to update
application.formatted-version=v1.4.0 GA
#for freemarker
......
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.en=English
global.change.language.zh=\u4E2D\u6587
......
global.application=MaxKey Secure Sign-on System
global.application.version=v1.3.0 GA
global.change.language=Language
global.change.language.en=English
global.change.language.zh=\u4E2D\u6587
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册