Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New JSP user looking for help with error message

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi folks,<br><br>I'm somewhat new at using JSP and am having a tough time debugging the programs because the error messages are for a different "level" of code. You know what I mean. <br><br>Anyway, the two messages I keep getting are:<br><br>/web/ibm/was.2.03adv/servlets/pagecompile/_SpacemanReports/_UserReport2_xjsp.java:137: Can't specify array dimension in a declaration.<br> data[0].writeChars(1495, 1, out);<br> ^<br>/web/ibm/was.2.03adv/servlets/pagecompile/_SpacemanReports/_UserReport2_xjsp.java:137: Identifier expected.<br> data[0].writeChars(1495, 1, out);<br> ^<br>Perhaps some of you more experienced JSP programmers can at least point me in the right direction concerning what parts to look at. <br><br><br>Oh and here's my code, if you're interested:<br><br>%@ language="java" import="java.util.*" %<br><br>h3 Spaceman User Reports<br><br>HttpSession session = request.getSession(true);<br><br>String message=(String)session.getValue("Message");<br><br>// ResultSet is used to check if the user has requested anything yet<br>ResultSet rs=(ResultSet)session.getValue("ResultSet");<br><br>if (message != null) { % h4 %= message % /h4 <BR> % }<br>session.putValue("Message","");<br><br>// If RecordSet is null then just display opening form.<br>if (rs == null) {<br><br>%<br> form method="POST" action="/servlet/UserReportServlet2"<br>center<br> table border=0 cellspacing=0 width=100%<br>tr<br>td align=right width=25% Employee Serial No: /td<br> td input type=test name=empsn size=10 /td<br> /tr<br>/table<br>input type=submit name=submit value=Submit<br>/center<br>/form<br><br>%br}<br><br>// If RecordSet is not null, display the results held within it<br><br>else {<br> try {<br> ResultSetMetaData rsMeta=rs.getMetaData(); %<br> table border="2" cellpadding="3"<br> tr<br><br>// display the Column Headings:<br> % for (int i=1; i=rsMeta.getColumnCount();i++) { %<br> td h4 %= rsMeta.getCoumnName(i) % /h4 /td <br> % } %<br> /tr<br><br> % while (rs.next()) { %<br> tr<br> % for (int i=1; i =rsMeta.getColumnCount();i++) { %<br> td %= rs.getObject(i) %/td<br> % } %<br> /tr<br> % } % /table<br> %<br> rs.close();<br> rs=null;<br> session.removeValue("ResultSet");<br> } catch (Exception any) { % An Error occured. %= any.getMessage() % % }<br>}<br>}<br>%<br><br>Thank you,<br>beckyg
 
Becky,<br><br>Sorry I made a mistake and messed up the formatting for all of your code.&nbsp;&nbsp;If you want, just re-post your code as a REPLY to your question.<br><br>Sorry about that again...<br><br>Dave
 
I can't seem to repost the page, it is picking up the html and translating it.&nbsp;&nbsp;But that's okay, if someone could just give me an idea of what might be wrong, or general things to look more closely at, that might be all I need to get me over the hump.<br><br>Thanks again,<br>beckyg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top