title: Declaring functions in JSP?
body: <p>I come from PHP world, where declaring a function in the middle of a php page is pretty simple.
  I tried to do the same in JSP:</p>
  
  <pre><code>public String getQuarter(int i){
  String quarter;
  switch(i){
      case 1: quarter = "Winter";
      break;
  
      case 2: quarter = "Spring";
      break;
  
      case 3: quarter = "Summer I";
      break;
  
      case 4: quarter = "Summer II";
      break;
  
      case 5: quarter = "Fall";
      break;
  
      default: quarter = "ERROR";
  }
  
  return quarter;
  }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>An error occurred at line: 20 in the jsp file: /headers.jsp
  Illegal modifier for the variable getQuarter; only final is permitted return;
  </code></pre>