Getting HTTP Request properties and attributes in freemarker template


/ Published in: Other
Save to your folder(s)

The Request and RequestParameters are two Hashes provided by freemarker, it will be available in all templates


Copy this code and paste it in your HTML
  1. /*
  2. *To get access to Request Parameters use one of the following syntaxes where test is the request property
  3. */
  4. ${RequestParameters['test']}
  5. or
  6. ${RequestParameters.test}
  7.  
  8. /*
  9. *to get access to Request Attributes use one of the following where test is the request attribute
  10. */
  11. ${Request['test']}
  12. or
  13. ${Request.test}

URL: http://forum.springframework.org/showthread.php?t=32846

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.