Jquery Error executing FreeMarker template:The following has evaluated to null or missing,空指针异常

异常如下:

2019-09-05 17:47:54.941 |-ERROR [http-nio-8089-exec-7] freemarker.runtime [59] -| Error executing FreeMarker template
freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> info.url  [in template "admin/wechatPublic/edit.ftl" at line 27, column 98]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to be 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. (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):
	- Failed at: ${info.url}  [in template "admin/wechatPublic/edit.ftl" at line 27, column 96]
----
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
	at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:451)
	at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:374)
	at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:59)
	at freemarker.core.Environment.visit(Environment.java:327)
	at freemarker.core.Environment.visit(Environment.java:333)
	at freemarker.core.Environment.process(Environment.java:306)
	at freemarker.template.Template.process(Template.java:386)
	at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:367)
	at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:284)
	at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:234)
。。。。。。。

解决办法:

1.配置 FreeMarker 时



	
	
	
	
		
			
			true
			10
			zh_CN
			yyyy-MM-dd HH:mm:ss
			yyyy-MM-dd
			#.##
		
	
	
		
			
			
		
	

添加:


true

2.前端判断null修改

改为

你可能感兴趣的:(FreeMarker,空指针,前端,FreeMarker)