• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JSP code Error

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Nmohamed rafi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here i want to display 3rows of mysql table in output. it shows 7errors how to solve this error? please tell how to reactify the error. i am having 7 errors, i want to show mysql table. i need correct mysql query
 
Nmohamed rafi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These are the 7 code errors

Generated servlet error:
   [javac] Since fork is true, ignoring compiler setting.
   [javac] Compiling 1 source file
   [javac] Since fork is true, ignoring compiler setting.
   [javac] C:\Program Files (x86)\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\SCALEUP\report_jsp.java:91: illegal start of expression
   [javac]
   [javac]                         ^
   [javac] C:\Program Files (x86)\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\SCALEUP\report_jsp.java:68: sdbName is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
   [javac]       sdbName = request.getParameter("scaleup");
   [javac]       ^
   [javac] C:\Program Files (x86)\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\SCALEUP\report_jsp.java:82: cannot resolve symbol
   [javac] symbol  : variable region  
   [javac] location: class org.apache.jsp.report_jsp
   [javac] rsT = stmt.executeQuery("select * from scaleupdata where sregion= '" + region + "' and sregion1='" + region1 + "' and sregion2='" + region2 + "'");
   [javac]                                                                                        ^
   [javac] C:\Program Files (x86)\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\SCALEUP\report_jsp.java:82: cannot resolve symbol
   [javac] symbol  : variable region1  
   [javac] location: class org.apache.jsp.report_jsp
   [javac] rsT = stmt.executeQuery("select * from scaleupdata where sregion= '" + region + "' and sregion1='" + region1 + "' and sregion2='" + region2 + "'");
   [javac]                                                                                                                      ^
   [javac] C:\Program Files (x86)\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\SCALEUP\report_jsp.java:82: cannot resolve symbol
   [javac] symbol  : variable region2  
   [javac] location: class org.apache.jsp.report_jsp
   [javac] rsT = stmt.executeQuery("select * from scaleupdata where sregion= '" + region + "' and sregion1='" + region1 + "' and sregion2='" + region2 + "'");
   [javac]                                                                                                                                                     ^
   [javac] C:\Program Files (x86)\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\SCALEUP\report_jsp.java:101: cannot resolve symbol
   [javac] symbol  : variable rst  
   [javac] location: class org.apache.jsp.report_jsp
   [javac] result=rst.getInt(2);
   [javac]        ^
   [javac] C:\Program Files (x86)\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\SCALEUP\report_jsp.java:104: cannot resolve symbol
   [javac] symbol  : variable rst  
   [javac] location: class org.apache.jsp.report_jsp
   [javac] result=rst.getInt(3);
   [javac]        ^
   [javac] 7 errors
 
Saloon Keeper
Posts: 28325
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your primary error is that you put a lot of Java code in a JSP.

Scriptlets are a very obsolete thing. They are virtually impossible to debug and the mix of 2 very different kinds of languages in the same file drives text editors insane.

You should move your Java code into a servlet, have the servlet store its results into Request-scope javabeans, then forward to the JSP to do the display.

JSPs are very good for templating web pages, but are really awful for processing code.
 
Bartender
Posts: 669
15
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even if you are putting the java code in the JSP it still follows the same rules as any other java.  The error messages you posted contain the reason why it doesn't compile.
 
Legend has it that if you rub the right tiny ad, a genie comes out.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic