facebook

jsp compiler error

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #258495 Reply

    Andrea Mari
    Member

    Hi,

    I’ve a jsp declaring the same variable in two differente try/catch blocks. Jsp compiler mark this as an error (duplicate variable declaration), but this is not a compiler error. In fact my application server (resin) compile the page without problems.

    By
    A.

    #258573

    Riyad Kalla
    Member

    I cannot reproduce this using Eclipse 3.2 and MyEclipse 5.0, here’s my page:

    
    <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <%
      try
      {
          int i = Integer.parseInt("4");
      }
      catch(NumberFormatException e)
      {
          e.printStackTrace();
      }
      %>
      <%
      try
      {
          int i = Integer.parseInt("4");
      }
      catch(NumberFormatException e)
      {
          e.printStackTrace();
      }
      %>
    </html>
    
    #258611

    Andrea Mari
    Member

    try this example page:

    
    <%
      try{
          Object customer = null;
    
          if (customer == null) {
    %>
    <html><head><title>Errore</title></head><body></html>
    <%
          }
          else {
            Object ste = null;        
          }
      }
      catch (Exception ex) {
    %>
    <!-- 
    <%
        Object ste;
    %>
    -->
    <% } %>
    
    #258614

    Riyad Kalla
    Member

    Yep that did the trick, thank you for the sample file.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: jsp compiler error

You must be logged in to post in the forum log in