title: How to split up a jsp file into different child subfile which will be shared by multiple parent files
body: <p>Recently I came across a situation which is described as follows :</p>
  
  <p>I have a struts action class for instance say A. Let say the corresponding jsp file is show.jsp
     Now i have a requirement to show some extra stuff in the jsp file so I extended the struts action class and the new class called as B but i am using the same show.jsp. But i passed an extra parameter to show.jsp and i check in the show.jsp like following to show appropriate content</p>
  
  <pre><code>         if(popo){ 
               @include "popo.jsp".
           }else{
               @include "original content present before the requirement."
           }
  </code></pre>
  
  <p>Recently I have one more requirement like new struts action class C which also use show.jsp to render the html but the new requirement and the previous requirement share somewhat similar html content.So now i code looks like</p>
  
  <pre><code>          if(popo || jojo){ 
               @include "popo.jsp".
           }else{
               @include "original content present before the requirement."
           }
  </code></pre>
  
  <p>but inside popo.jsp i again check like </p>
  
  <pre><code>              if(jojo){
                }else{
                }
  </code></pre>
  
  <p>because i want not all things from popo to be displayed for jojo </p>
  
  <p>I would like to know if it's a good practice to do this kind of stuff.It's getting messy each day. Is there any way i can make things cleaner.?</p>