主题 : 我想发布新闻的时候作者名称自动获取登陆管理员的名称 |
级别: 童生
![]() |
11# 发表于:2017-12-05 11:21:45 IP:175.176.*.*
|
||||
---|---|---|---|---|---|
级别: 童生
![]() |
14# 发表于:2017-12-05 11:25:48 IP:175.176.*.*
<#elseif item.field=="origin">
<@p.td help=item.help helpPosition="${item.helpPosition!2}" label=item.label colspan=item.single?string("2","1") width="${item.single?string(100,50)}"> <@p.text name=item.field value="${user.username!}" maxlength="100" style="width:70px"/> <@s.m "content.originUrl"/>: <input type="text" name="originUrl" maxlength="255" style="width:100px"/> </@p.td> 大....大佬,放进去显示这个,我是不是放错位置了 FreeMarker template error: The following has evaluated to null or missing: ==> user [in template "csagri_sys/content/add.html" at line 392, column 35] Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)?? The failing instruction (FTL stack trace): ---------- ==> ${user.username!} [in template "csagri_sys/content/add.html" at line 392, column 33] @p.text name=item.field value="\${use... [in template "csagri_sys/content/add.html" at line 392, column 1] #nested [in template "ftl/csagri/ui/td.ftl" in macro "td" at line 16, column 1] @p.td help=item.help helpPosition="\$... [in template "csagri_sys/content/add.html" at line 391, column 1] #elseif item.field == "origin" [in template "csagri_sys/content/add.html" at line 390, column 1] #if !item.custom [in template "csagri_sys/content/add.html" at line 325, column 1] #nested [in template "ftl/csagri/ui/form.ftl" in macro "form" at line 25, column 1] @p.form id="jvForm" action="o_save.do... [in template "csagri_sys/content/add.html" at line 320, column 1] ---------- Java stack trace (for programmers): ---------- freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98) at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(UnexpectedTypeException.java:41) at freemarker.core.UnexpectedTypeException.(UnexpectedTypeException.java:24) at freemarker.core.Dot._eval(Dot.java:81) at freemarker.core.Expression.eval(Expression.java:111) at |
||
---|---|---|---|
级别: 童生
![]() |
15# 发表于:2017-12-05 11:30:48 IP:175.176.*.*
欢迎<#if user.realname??> ${user.realname}<#else>${user.username}</#if> 登录${site.name!}
进入网站我这里的可以获取到用户名称,我把${user.username}标签复制到新闻发布界面里去就出不来了 |
||
---|---|---|---|
级别: 总版主
![]() |
16# 发表于:2017-12-05 11:33:10 IP:182.12.*.*
"csagri_sys/content/add.html" a这是什么模板!我是让你放到前台的content/new.html新闻详情页模板
|
||
---|---|---|---|
级别: 童生
![]() |
17# 发表于:2017-12-05 11:41:21 IP:175.176.*.*
csagri_sys/content/add.html 这个是后台新闻发布的模板,打算发布新闻的时候直接获取当前管理员名称作为默认来源的
|
||
---|---|---|---|
级别: 童生
![]() |
19# 发表于:2017-12-05 11:50:45 IP:175.176.*.*
好的,谢谢大佬们
|
||
---|---|---|---|