是否有可能在XPage中获取Java中的getLocaleString()值?

时间:2018-06-12 07:09:47

标签: java xpages

是否可以在getLocaleString()中获取Java中的XPages值? 在SSJS我可以按以下方式获取 -

context.getLocaleString() ;

Java中有类似的东西吗?

2 个答案:

答案 0 :(得分:1)

您可以通过以下方式获取XSPContext对象:

XSPContext context = XSPContext.getXSPContext(FacesContext.getCurrentInstance());
context.getLocaleString();

您还可以使用XPages扩展库中的ExtLibUtil来获取XSPContext对象:

com.ibm.xsp.extlib.util.ExtLibUtil.getXspContext();

因此,您可以执行此操作以获取区域设置字符串:

ExtLibUtil.getXspContext().getLocaleString();

答案 1 :(得分:1)

我以前用过这个:

(function(angular) {

	var module = angular.module('umbraco',[]);

	module.controller('UmbracoForms.Overlays.FieldSettingsOverlay', function($scope, $document) {
    this.validationTypes = [{
            "key": "number",
            "pattern": "^[0-9]*$"
        }, {           
            "key": "url",
            "pattern": "https?\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}"
        }];
		this.changeValidationType = function() {
     console.log("Parent")
			return this.validationTypes;
		};
	});

})(angular);
var module = angular.module('example1',['umbraco']);
module.controller('FromValidationCustomController', function($scope, $controller) {
console.log("inistiate");
		angular.extend(this, $controller('UmbracoForms.Overlays.FieldSettingsOverlay', {$scope: $scope}));
	});