Connecting Tech Pros Worldwide Forums | Help | Site Map

java Syntax error in jsp

Familiar Sight
 
Join Date: Nov 2006
Location: PJ,Malaysia
Posts: 255
#1: Sep 25 '07
i calling this piece of java code in jsp :
Expand|Select|Wrap|Line Numbers
  1. List<Customer> list = Customer.listby_page(currentRs);
  2. ...
  3. ...
  4.  
then it gives me the following error:

Expand|Select|Wrap|Line Numbers
  1. org.apache.jasper.JasperException: Unable to compile class for JSP
  2.  
  3. An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
  4. Generated servlet error:
  5. Syntax error on token "<", invalid AssignmentOperator
  6.  
  7. An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
  8. Generated servlet error:
  9. Syntax error on token "=", != expected
  10.  
  11. An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
  12. Generated servlet error:
  13. Syntax error on token(s), misplaced construct(s)
  14.  
  15. An error occurred at line: 35 in the jsp file: /admin/sendBulkSMS.jsp
  16. Generated servlet error:
  17. Syntax error on token ")", : expected
  18.  
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's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Posts: 2,451
#2: Sep 25 '07

re: java Syntax error in jsp


Expand|Select|Wrap|Line Numbers
  1. List<Customer> list = Customer.listby_page(currentRs);
  2.  
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.
Familiar Sight
 
Join Date: Nov 2006
Location: PJ,Malaysia
Posts: 255
#3: Sep 27 '07

re: java Syntax error in jsp


fixed.

thanks anyway

from
Nick
Familiar Sight
 
Join Date: Nov 2006
Location: PJ,Malaysia
Posts: 255
#4: Oct 3 '07

re: java Syntax error in jsp


sorry,

here is the code :
Expand|Select|Wrap|Line Numbers
  1. public static List<Customer> listby_page(int currentRs) throws SQLException
  2.     {
  3.         ArrayList<Customer> arraylist = new ArrayList<Customer>();
  4.         Connection conn = DbConnectionManager.getConnection();
  5.         try
  6.         {                                
  7.             PreparedStatement st = conn.prepareStatement("select * from ambulk_customer LIMIT "+currentRs +",15 ");
  8.             ResultSet rs = st.executeQuery();
  9.  
  10.             while (rs.next())
  11.                 arraylist.add( new Customer(rs) );                    
  12.  
  13.             rs.close();
  14.             st.close();                                                
  15.         }
  16.         finally
  17.         {
  18.             DbConnectionManager.release(conn);
  19.         }                
  20.         return arraylist;
  21.     }
  22.  
my version is 1.6.02.

the problem still remain the same....

anyone could tell the possibility?
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#5: Oct 3 '07

re: java Syntax error in jsp


Quote:

Originally Posted by nickyeng

sorry,

here is the code :

Expand|Select|Wrap|Line Numbers
  1. public static List<Customer> listby_page(int currentRs) throws SQLException
  2.     {
  3.         ArrayList<Customer> arraylist = new ArrayList<Customer>();
  4.         Connection conn = DbConnectionManager.getConnection();
  5.         try
  6.         {                                
  7.             PreparedStatement st = conn.prepareStatement("select * from ambulk_customer LIMIT "+currentRs +",15 ");
  8.             ResultSet rs = st.executeQuery();
  9.  
  10.             while (rs.next())
  11.                 arraylist.add( new Customer(rs) );                    
  12.  
  13.             rs.close();
  14.             st.close();                                                
  15.         }
  16.         finally
  17.         {
  18.             DbConnectionManager.release(conn);
  19.         }                
  20.         return arraylist;
  21.     }
  22.  
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.
Reply