title: How to encode decode string in thymeleaf
body: <p>I want to encode string or any primitives values in <code>Thymeleaf</code> and decode same on server, mostly path variable or in hidden fields. Actually i want this due to security reasons.</p>
  
  <p><strong>Effort</strong></p>
  
  <pre><code>&lt;a th:href="@{/administrator/{id}edit/(id=${data.id})}" class="instructionbt"&gt;Edit&lt;/a&gt;
  </code></pre>
  
  <p>This is a simple link to edit data and can be see in url something like this:</p>
  
  <pre><code>localhost:8080/testapp/administrator/1/edit
  </code></pre>
  
  <p>but i want something like</p>
  
  <pre><code>localhost:8080/testapp/administrator/$Htf1w==/edit
  </code></pre>
  
  <p>Now can replace 1 by 2, 3 even any number and can edit any data. I want that 1 (the id field) must be encode, so that id will be hard to guess and a normal user will not edit url directly.</p>
  
  <p>I have search a lot on internet, but i did not found any clue. I know i can use <code>Base64Utils</code> or any similar class to achieve, but question is how to do in <code>Thymeleaf.</code></p>
  
  <p>Please friends help me. I am stuck in my project and i am having very less time.  </p>