title: Why does EL >= sometimes give wrong results?
body: <p>I have this JSP EL expression, which uses the >= comparator. On my development environment I get the result you would expect, namely that 2 >= 188 is false. However, on my staging and production servers apparently 2 >= 188 is true.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;/ul&gt;
  &lt;p&gt;curPage: ${param.curPage}&lt;br/&gt;
  totalPages: ${param.totalPages}&lt;br/&gt;
  totalPages - curPage: ${param.totalPages - param.curPage}&lt;br/&gt;
  curPage gt totalPages: ${param.curPage &gt;= param.totalPages}&lt;br/&gt;
  &lt;p&gt;
  </code></pre>
  
  <p>On my development environment, I get output like this:</p>
  
  <pre><code>curPage: 2
  totalPages: 68
  totalPages - curPage: 66
  curPage gt totalPages: false
  </code></pre>
  
  <p>On staging:</p>
  
  <pre><code>curPage: 2
  totalPages: 181
  totalPages - curPage: 179
  curPage gt totalPages: true
  </code></pre>
  
  <p>My development environment is running Tomcat 7.0.29, staging is running 7.0.30. The codebases are the same.</p>
  
  <p>The above code is in a file "pagination.jsp" (I know, it should be a .tag), which is included into another jsp like this:</p>
  
  <pre><code>&lt;jsp:include page="/widgets/pagination.jsp"&gt;
      &lt;jsp:param name="totalPages" value="${actionBean.jbp.totalPages}" /&gt;
      &lt;jsp:param name="baseUrl" value="${baseUrl}" /&gt;
      &lt;jsp:param name="curPage" value="${not empty param.page?param.page:0}" /&gt;
  &lt;/jsp:include&gt;
  </code></pre>
  
  <p>"jbp.totalPages" is defined as:</p>
  
  <p>private final int totalPages;</p>
  
  <p>and "param.page" is obviously a page parameter.</p>
  
  <p>I suppose there could be a type conversion problem here, between the parameter and the int, but that does not explain why it works on one machine and not the other.</p>
  
  <p>Also, I thought JSP EL did automatic type conversion.</p>
  
  <p>Any thoughts would be appreciated.</p>