title: create java function in a jsp file and call it from another jsp file
body: <p>We generally create methods in a java class, import them into a jsp file and call those methods in our jsp files.</p>
  
  <p>But we are working in a client environment, we do not have access to create or modify .java files. So we desperately need to create a function in a jsp file and call it from another jsp file.</p>
  
  <p>For example:</p>
  
  <p>A.jsp</p>
  
  <pre><code>.....
  &lt;jsp:include page="B.jsp"/&gt;
  ....
  &lt;%= getName(); %&gt;
  </code></pre>
  
  <p>B.jsp ....</p>
  
  <pre><code>&lt;%!
  public String getName()
  {
   return "Hello";
  }
  &gt;%
  </code></pre>
  
  <p>Is there  any way to do this?. </p>