S
smm1
I have a method that takes a variable length arg list:
"testmethod(int...in)".
Using this method from a 'regular' java program (i.e. via 'main') works
just fine, but when invoked from Tomcat/JSP I get an error:
"Generated servlet error:
The method testmethod(int[]) in the type testclass is not applicable
for the arguments (int, int, int)"
The java:
package testpackage ;
public class testclass {
public static int testmethod(int... in) {
return in[1] ;
}
public static void main(String[] args) {
System.out.println(testmethod(1,2,3)) ;
}
}
The JSP:
<%@ page import="testpackage.testclass.*" %>
<%
out.println(testpackage.testclass.testmethod(1,2,3));
%>
I'm using Tomcat 5.5.12 and java 1.5.0_06.
Any ideas on how I can get this JSP to compile? Thanks for any help.
"testmethod(int...in)".
Using this method from a 'regular' java program (i.e. via 'main') works
just fine, but when invoked from Tomcat/JSP I get an error:
"Generated servlet error:
The method testmethod(int[]) in the type testclass is not applicable
for the arguments (int, int, int)"
The java:
package testpackage ;
public class testclass {
public static int testmethod(int... in) {
return in[1] ;
}
public static void main(String[] args) {
System.out.println(testmethod(1,2,3)) ;
}
}
The JSP:
<%@ page import="testpackage.testclass.*" %>
<%
out.println(testpackage.testclass.testmethod(1,2,3));
%>
I'm using Tomcat 5.5.12 and java 1.5.0_06.
Any ideas on how I can get this JSP to compile? Thanks for any help.