Data AccessCore JavaApp FrameworksViewTestingBuildingDeploymentDev ToolsSecurityOpinions

Thursday, April 9, 2009

Escape Sequence and Raw String Literal for ${} in FreeMarker

I use freemarker to generate JSP's to quickly generate simple CRUD actions. During the development of this code generator I needed a way to escape ${} and print out that string literal.

To indicate that a string literal is a raw string literal, you have to put an r directly before the opening quotation mark or apostrophe-quote.

Example:
${r"${example}"}

will print:
${example}
C:\foo\bar

Anymore questions about FreeMarker? Just ask me by providing a comment and I'll mull over it. Thanks!

3 comments:

  1. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai

    ReplyDelete
  2. Numerous shipper loan moneylenders publicize that the cash will be accessible in as quick as 10 days, and dissimilar to a bank advance that have a settled financing cost, as the sum due and due date are settled every month, regardless of if your business drop. Rather, with a dealer loan the payback Payday Loans
    originates from future Visa receivables, not stressing your business income.

    ReplyDelete