You are declaring the String array twice in your code.

The first one is okay...

String [] _tmpS = new String[7];

but you can't do this again in your code. If you want to create a new String
array for _tmpS after already declaring _tmpS you should do it without
declaring it...

_tmpS = new String[7];

Hope this helps.

-Y

---------------------------
Yoav Morahg
Software Engineer
Gist Communications
(212) 965-1999 xt 110
[EMAIL PROTECTED]

Interactive Television Guides


-----Original Message-----
From: Moran, David (David) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 19, 2000 5:50 PM
To: [EMAIL PROTECTED]
Subject: Compile Error in JSP generated servlet


What would cause JSP to generate the same variable in the generated servlet.
I am getting the following compile error in the JSP generated servlet in
tomcat 3.2 on Windows NT.  I am trying to get the book examples to run from
"SE Using Java Server Pages and Servlets"

Error: 500

Location: /examples/examples/ShowPeople.jsp

Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSPD:\java\servlet\jakarta-tomcat-3.2\work\localhost_8080%2Fexamples\_0002fe
xamples_0002fShowPeople_0002ejspShowPeople_jsp_0.java:75: Variable '_tmpS'
is already defined in this method.
                    String [] _tmpS = new String[7];
                              ^
D:\java\servlet\jakarta-tomcat-3.2\work\localhost_8080%2Fexamples\_0002fexam
ples_0002fShowPeople_0002ejspShowPeople_jsp_0.java:83: Variable '_tmpS' is
already defined in this method.
                    String [] _tmpS = new String[7];
                              ^


This is the offending code from the servlet

// begin
[file="D:\\java\\servlet\\jakarta-tomcat-3.2\\webapps\\examples\\examples\\S
howPeople.jsp";from=(14,0);to=(46,14)]
                {
                    String _jspx_qStr = "";
                    _jspx_qStr = _jspx_qStr + "?tableOptions=" + "BORDER=4";
                    String [] _tmpS = new String[7];
                    _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
                    _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
                    _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
                    _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
                    _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
                    _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
                    _jspx_qStr = _jspx_qStr + "&columnType=" + "data";
                    String [] _tmpS = new String[7];
                    _jspx_qStr = _jspx_qStr + "&column=" + "name";
                    _jspx_qStr = _jspx_qStr + "&column=" + "age";
                    _jspx_qStr = _jspx_qStr + "&column=" + "city";
                    _jspx_qStr = _jspx_qStr + "&column=" + "state";
                    _jspx_qStr = _jspx_qStr + "&column=" + "country";
                    _jspx_qStr = _jspx_qStr + "&column=" + "postalCode";
                    _jspx_qStr = _jspx_qStr + "&column=" + "email";
                    String [] _tmpS = new String[7];
                    _jspx_qStr = _jspx_qStr + "&columnHeader=" + "Name";
                    _jspx_qStr = _jspx_qStr + "&columnHeader=" + "Age";
                    _jspx_qStr = _jspx_qStr + "&columnHeader=" + "City";
                    _jspx_qStr = _jspx_qStr + "&columnHeader=" + "State";
                    _jspx_qStr = _jspx_qStr + "&columnHeader=" + "Country";
                    _jspx_qStr = _jspx_qStr + "&columnHeader=" + "Postal
Code";
                    _jspx_qStr = _jspx_qStr + "&columnHeader=" + "E-Mail";
                    _jspx_qStr = _jspx_qStr + "&data=" + "people";
                    pageContext.include("TableServlet" + _jspx_qStr);
                }

Reply via email to