title: put the logical decision in the controller or in the view
body: <p>In my application user can create post,however only the creator of the post can delete it.</p>
  
  <p>So I have to make the decision for each post when I list them.</p>
  
  <p>Then which is better to to this logic decision,in the controller or in the view?</p>
  
  <p>Now I do it in the view:</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>class PostController{
    @RequestMapping("post/list")
    public void list(Model m){
     List&lt;Post&gt; posts=queryPosts();
     m.addAttribute(posts);
    }
  }
  </code></pre>
  
  <p><strong>post_list.ftl</strong></p>
  
  <pre><code>&lt;#list ${posts} as post&gt;
    &lt;span&gt;${post.name}&lt;/span&gt;
    &lt;#if ${post.owner}==${session.user}&gt;
      &lt;a href="post/${post.id}/delete"&gt;Delete&lt;/a&gt;
    &lt;/#if&gt;
  &lt;/#list&gt;
  </code></pre>
  
  <p>Then I want to know if this is the best practice?</p>
  
  <p>If put the logic decesion in the controller is better,then how to make it? Add an <code>editable</code> field of the Post?</p>