Thanks- man is my face red ;-)
Jason
"Jurrius, Mark" wrote:
> Your else statement is missing a bracket. Try using } else {
>
> Hope it helps.
>
> Mark
>
> -----Original Message-----
> From: Jason Novotny [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: jsp function declaration
>
> Hi,
>
> 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
> /usr/local/tomcat/tomcat-3.3-m2/work/DEFAULT/demo/jsp/filetransfer/showfiles
> _1.java:25:
> Class or interface declaration expected.
> static {
> ^
> /usr/local/tomcat/tomcat-3.3-m2/work/DEFAULT/demo/jsp/filetransfer/showfiles
> _1.java:13:
> 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
> org.apache.jasper.runtime.HttpJspBase.
> 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 [EMAIL PROTECTED]
> Home: (510) 610-8360 Work: (510) 486-8662
> NERSC Distributed Computing http://www-didc.lbl.gov
--
Jason Novotny [EMAIL PROTECTED]
Home: (510) 610-8360 Work: (510) 486-8662
NERSC Distributed Computing http://www-didc.lbl.gov