tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Novotny <>
Subject jsp function declaration
Date Thu, 26 Apr 2001 18:43:45 GMT


    I have  a very simple JSP function that looks like:

<%! public String isSelected(String var, String checkvar) {
             if (var.equals(checkvar)) {
                 return "selected";
             } else
                 return "";

    Only problem is whenever I load my page, I get the following error:

org.apache.jasper.JasperException: Unable to compile
Class or interface declaration expected.
    static {
class jsp.filetransfer.showfiles_1 must be declared abstract. It does
not define void _jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) from class
public class showfiles_1 extends org.apache.jasper.runtime.HttpJspBase {

2 errors

    I've tried adding thsi snippet to the numguess.jsp example without
any problem and all the books I've read indicate this is perfectly
acceptable programming.

    Any ideas, why adding methods doesn't work with my page?

    Thanks very much, Jason

Jason Novotny     
Home: (510) 610-8360        Work: (510) 486-8662
NERSC Distributed Computing

View raw message