Java 强制将指令解释为文本?
我正在使用Java和ApacheVelocity模板生成一些C代码。目前,我必须转义Java 强制将指令解释为文本?,java,escaping,velocity,Java,Escaping,Velocity,我正在使用Java和ApacheVelocity模板生成一些C代码。目前,我必须转义#define预处理器指令,因为ApacheVelocity也使用该指令。有没有可能告诉Apache Velocity不要将\define解释为Velocity的指令,而不必总是转义\define 谢谢你的提示 VTL指令可以使用反斜杠(\)以类似于有效VTL引用的方式转义 \#define will renders texts as #define #定义 #包括(“a.txt”) 有关更多信息,请参阅:
#define
预处理器指令,因为ApacheVelocity也使用该指令。有没有可能告诉Apache Velocity不要将\define
解释为Velocity的指令,而不必总是转义\define
谢谢你的提示 VTL指令可以使用反斜杠(\)以类似于有效VTL引用的方式转义
\#define will renders texts as #define
#定义
#包括(“a.txt”)
有关更多信息,请参阅:
## \#include( "a.txt" ) renders as #include( "a.txt" )