java Syntax error in jsp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickyeng
    Contributor
    • Nov 2006
    • 252

    java Syntax error in jsp

    i calling this piece of java code in jsp :
    Code:
    List<Customer> list = Customer.listby_page(currentRs);
    ...
    ...
    then it gives me the following error:

    Code:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    
    An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
    Generated servlet error:
    Syntax error on token "<", invalid AssignmentOperator
    
    An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
    Generated servlet error:
    Syntax error on token "=", != expected
    
    An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
    Generated servlet error:
    Syntax error on token(s), misplaced construct(s)
    
    An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
    Generated servlet error:
    Syntax error on token ")", : expected
    i use Eclipse SDK 3.2 for this project, using jre 16.02.
    when i run in local server, it bangs me with the same error again and again...

    what is wrong ?

    from
    Nick
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    [code=java]
    List<Customer> list = Customer.listby _page(currentRs );
    [/code]

    What is the explanation of Customer.listby _page(currentRs );?
    And what is the version of your J2SE?
    Your J2SE should be 1.5 or later to support Generics.

    Kind regards,
    Dmjpro.

    Comment

    • nickyeng
      Contributor
      • Nov 2006
      • 252

      #3
      fixed.

      thanks anyway

      from
      Nick

      Comment

      • nickyeng
        Contributor
        • Nov 2006
        • 252

        #4
        sorry,

        here is the code :
        Code:
        public static List<Customer> listby_page(int currentRs) throws SQLException
        	{
        		ArrayList<Customer> arraylist = new ArrayList<Customer>();
        		Connection conn = DbConnectionManager.getConnection();
        		try
        		{								
        			PreparedStatement st = conn.prepareStatement("select * from ambulk_customer LIMIT "+currentRs +",15 ");
        			ResultSet rs = st.executeQuery();
        			
        			while (rs.next())
        				arraylist.add( new Customer(rs) );					
        			
        			rs.close();
        			st.close();												
        		}
        		finally
        		{
        			DbConnectionManager.release(conn);
        		}				
        		return arraylist;
        	}
        my version is 1.6.02.

        the problem still remain the same....

        anyone could tell the possibility?

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by nickyeng
          sorry,

          here is the code :
          Code:
          public static List<Customer> listby_page(int currentRs) throws SQLException
          	{
          		ArrayList<Customer> arraylist = new ArrayList<Customer>();
          		Connection conn = DbConnectionManager.getConnection();
          		try
          		{								
          			PreparedStatement st = conn.prepareStatement("select * from ambulk_customer LIMIT "+currentRs +",15 ");
          			ResultSet rs = st.executeQuery();
          			
          			while (rs.next())
          				arraylist.add( new Customer(rs) );					
          			
          			rs.close();
          			st.close();												
          		}
          		finally
          		{
          			DbConnectionManager.release(conn);
          		}				
          		return arraylist;
          	}
          my version is 1.6.02.

          the problem still remain the same....

          anyone could tell the possibility?
          The errors are in /admin/sendBulkSMS.jsp . That's what you should be looking at.

          Comment

          Working...