@Component public class SystemPropertiesDirective extends AbstractTemplateDirective
返回结果
java.version
:Java version number
java.vendor
:Java vendor specific string
java.vendor.url
:Java vendor URL
java.home
:Java installation directory
java.class.version
:Java class version number
java.class.path
:Java classpath
os.name
:Operating System Name
os.arch
:Operating System Architecture
os.version
:Operating System Version
file.separator
:File separator (SEPARATOR on Unix)
path.separator
:Path separator (":" on Unix)
line.separator
:Line separator ("\n" on Unix)
user.name
:User account name
user.home
:User home directory
user.dir
:User's current working directory
使用示例
<@tools.systemProperties>${.vars['java.version']}</@tools.systemProperties>
<script> $.getJSON('${site.dynamicPath}api/directive/tools/systemProperties?appToken=接口访问授权Token', function(data){ console.log(data['java.version']); }); </script>
限定符和类型 | 字段和说明 |
---|---|
(专用程序包) java.util.Properties |
props |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
SystemPropertiesDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
boolean |
needAppToken() |
execute, expose, getAdvanced, getApp, getSite, getUserId, needUserToken, supportAdvanced
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException
public boolean needAppToken()
needAppToken
在类中 AbstractTemplateDirective