Der Beispielcode aus "Java ist auche eine Insel" funktioniert bei mir nicht:
Woran kann das liegen, ist doch syntaktisch okay, oder?
Code:
<% if ( Math.random() > 0.5 ) { %>
Wow, bist du gut drauf.
<% } else { %>
Du bist ja ein super Hecht.
<% } %>
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
Syntax error, insert "else Statement" to complete IfStatement
Generated servlet error:
Syntax error, insert "}" to complete Block
Generated servlet error:
Syntax error on token "}", delete this token
Generated servlet error:
Syntax error, insert "}" to complete ClassBody
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.11 logs.
Woran kann das liegen, ist doch syntaktisch okay, oder?