开发者社区> 问答> 正文

springboot怎么配置velocity.properties文件呢?-java报错

springboot怎么配置velocity.properties文件呢?

展开
收起
montos 2020-05-31 23:30:38 605 0
1 条回答
写回答
取消 提交回答
  • "

    统一在application.properties配置:


    # VELOCITY TEMPLATES (VelocityAutoConfiguration)
    spring.velocity.allow-request-override=false # Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name.
    spring.velocity.allow-session-override=false # Set whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name.
    spring.velocity.cache= # Enable template caching.
    spring.velocity.charset=UTF-8 # Template encoding.
    spring.velocity.check-template-location=true # Check that the templates location exists.
    spring.velocity.content-type=text/html # Content-Type value.
    spring.velocity.date-tool-attribute= # Name of the DateTool helper object to expose in the Velocity context of the view.
    spring.velocity.enabled=true # Enable MVC view resolution for this technology.
    spring.velocity.expose-request-attributes=false # Set whether all request attributes should be added to the model prior to merging with the template.
    spring.velocity.expose-session-attributes=false # Set whether all HttpSession attributes should be added to the model prior to merging with the template.
    spring.velocity.expose-spring-macro-helpers=true # Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext".
    spring.velocity.number-tool-attribute= # Name of the NumberTool helper object to expose in the Velocity context of the view.
    spring.velocity.prefer-file-system-access=true # Prefer file system access for template loading. File system access enables hot detection of template changes.
    spring.velocity.prefix= # Prefix that gets prepended to view names when building a URL.
    spring.velocity.properties.*= # Additional velocity properties.
    spring.velocity.request-context-attribute= # Name of the RequestContext attribute for all views.
    spring.velocity.resource-loader-path=classpath:/templates/ # Template path.
    spring.velocity.suffix=.vm # Suffix that gets appended to view names when building a URL.
    spring.velocity.toolbox-config-location= # Velocity Toolbox config location. For instance `/WEB-INF/toolbox.xml`
    spring.velocity.view-names= # White list of view names that can be resolved.




    ######我主要是配置字符段为null的判断。 userdirective = org.apache.velocity.tools.generic.directive.Ifnull userdirective = org.apache.velocity.tools.generic.directive.Ifnotnull 。这个配置我要怎么配置呢?"
    2020-05-31 23:30:49
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载