atjiu / pybbs

更实用的Java开发的社区(论坛),Better use of Java development community (forum)
GNU Affero General Public License v3.0
1.84k stars 706 forks source link

用最新的master代码遇到freemarker错误 #136

Closed zenghonghai closed 3 years ago

zenghonghai commented 3 years ago

请求localhost:8080时报错: 2020-10-25 18:31:58 [XNIO-1 task-1] ERROR io.undertow.request - UT005023: Exception handling request to / org.springframework.web.util.NestedServletException: Request processing failed; nested exception is freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> site [in template "theme/default/layout/header.ftl" at line 3, column 44]


Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??


FTL stack trace ("~" means nesting-related):

zenghonghai commented 3 years ago

@tomoya92 麻烦大佬看看这个问题

zenghonghai commented 3 years ago

已解决。。。原来用curl才会出现这问题。。

li-sui commented 2 years ago

relates to #142

When using a non-browser client (e.g. curl, HTTP client), add the following header to the request will solve the issue:

Accept: text/html