tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens K├╝hnberger <Kuehnber...@web.de>
Subject Re: DO NOT REPLY [Bug 11646] New: - Jasper compilation problem: 'else' without 'if'
Date Tue, 13 Aug 2002 05:59:41 GMT
I don't think this is an error in jasper but in your source code.
If you do the if else the following way there shouldn't be any 
compilation error:

<% if (ua.indexOf("wildfire withtrail")>=0) { %>
<SCRIPT LANGUAGE="JavaScript1.2">var is_Wildfire=true</SCRIPT>
<% } else { %>
<SCRIPT LANGUAGE="JavaScript1.2">var is_Wildfire=false</SCRIPT>
<% } %>


bugzilla@apache.org wrote:
> DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
> RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
> <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11646>.
> ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
> INSERTED IN THE BUG DATABASE.
> 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11646
> 
> Jasper compilation problem: 'else' without 'if'
> 
>            Summary: Jasper compilation problem: 'else' without 'if'
>            Product: Tomcat 4
>            Version: 4.1.9
>           Platform: PC
>         OS/Version: Windows NT/2K
>             Status: NEW
>           Severity: Major
>           Priority: Other
>          Component: Jasper 2
>         AssignedTo: tomcat-dev@jakarta.apache.org
>         ReportedBy: arjaquith@mindspring.com
> 
> 
> I am getting a JSP compilation error in 4.1.9test that I had not been getting in
> 4.0.3.
> 
> THE ERROR (trimmed for brevity)
> ---------
> org.apache.jasper.JasperException: Unable to compile class for JSP
> 	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:477)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:182)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
> ...
> 
> root cause
> 
> org.apache.jasper.JasperException: Unable to compile class for JSP
> 
> An error occurred at line: 264 in the jsp file: /netmarkets/jsp/util/begin.jsp
> 
> Generated servlet error:
> Detected Java version: 1.3 in: d:\jdk1.3.1_02\jre
> Detected OS: Windows 2000
>     [javac] netmarkets\jsp\netmarkets\view_jsp.java added as
> D:\jakarta-tomcat-4.1.9\work\Tomcat-ForumPass\localhost\forumpass\netmarkets\jsp\netmarkets\view_jsp.class
> doesn't exist.
>     [javac] Compiling 1 source file
>     [javac] Using modern compiler
>     [javac] Compilation arguments:
>     [javac] '-classpath'
>     [javac]
> 'D:\jdk1.3.1_02\lib\tools.jar;D:\jakarta-tomcat-4.1.9\bin\bootstrap.jar;D:\jakarta-tomcat-4.1.9\common\lib\servlet.jar;D:\jakarta-tomcat-4.1.9\common\endorsed\xercesImpl.jar;D:\jakarta-tomcat-4.1.9\common\endorsed\xmlParserAPIs.jar;D:\ptc\Windchill\codebase;D:\ptc\Windchill\codebase\WEB-INF\lib\ie.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\JGL.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\HTTPClient.jar;D:\evincible\jlib\privacy.jar;D:\evincible\jlib\xercesImpl.jar;D:\evincible\jlib\xalan.jar;D:\evincible\jlib\iaik_jce.jar;D:\evincible\jlib\xss4j.jar;D:\evincible\jlib\log4j.jar;D:\evincible\jlib\classes12_9.jar;D:\evincible\jlib\xml-apis.jar;D:\evincible\jlib\kmcsp.jar;D:\evincible\jlib\kmjava.jar;D:\evincible\jlib\nfjava.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\CommonCoreMeta.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\Copy
> of
> xalan.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\JClass.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\OracleThinDrivers.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\RetrievalWare.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\activation.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\avalon-framework-4.0.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-awt-util.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-bridge.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-css.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-dom.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-ext.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-extension.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-gui-util.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-gvt.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-parser.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-script.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-svg-dom.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-svggen.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\ba
tik-transcoder.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-util.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\batik-xml.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\borland.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\fop.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\jakarta-regexp-1.2.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\javaCup.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\jaxp.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\jcert.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\jms.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\jnet.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\jsse.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\ldap.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\logkit-1.0b4.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\magelang.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\mail.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\providerutil.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\saxon-fop.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\saxon-jdom.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\saxon.jar;D:\ptc\Windchill
\codebase\WEB-INF\lib\sfc.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\soap.jar;D:\ptc\Windchill\codebase\WEB-INF\lib\xerces.jar;D:\jakarta-tomcat-4.1.9\shared\classes;D:\jakarta-tomcat-4.1.9\shared\lib\jasper-compiler.jar;D:\jakarta-tomcat-4.1.9\shared\lib\jasper-runtime.jar;D:\jakarta-tomcat-4.1.9\common\classes;D:\jakarta-tomcat-4.1.9\common\lib\activation.jar;D:\jakarta-tomcat-4.1.9\common\lib\ant.jar;D:\jakarta-tomcat-4.1.9\common\lib\commons-collections.jar;D:\jakarta-tomcat-4.1.9\common\lib\commons-dbcp.jar;D:\jakarta-tomcat-4.1.9\common\lib\commons-lang.jar;D:\jakarta-tomcat-4.1.9\common\lib\commons-logging-api.jar;D:\jakarta-tomcat-4.1.9\common\lib\commons-pool.jar;D:\jakarta-tomcat-4.1.9\common\lib\jasper-compiler.jar;D:\jakarta-tomcat-4.1.9\common\lib\jasper-runtime.jar;D:\jakarta-tomcat-4.1.9\common\lib\jdbc2_0-stdext.jar;D:\jakarta-tomcat-4.1.9\common\lib\jndi.jar;D:\jakarta-tomcat-4.1.9\common\lib\jta-spec1_0_1.jar;D:\jakarta-tomcat-4.1.9\common\lib\mail.jar;D:\jak
arta-tomcat-4.1.9\common\lib\naming-common.jar;D:\jakarta-tomcat-4.1.9\common\lib\naming-factory.jar;D:\jakarta-tomcat-4.1.9\common\lib\naming-resources.jar'
>     [javac] '-sourcepath'
>     [javac] 'D:\jakarta-tomcat-4.1.9\work\Tomcat-ForumPass\localhost\forumpass'
>     [javac] '-encoding'
>     [javac] 'UTF8'
>     [javac] '-g'
>     [javac] 
>     [javac] The ' characters around the executable and arguments are
>     [javac] not part of the command.
>     [javac] File to be compiled:
>     [javac]    
> D:\jakarta-tomcat-4.1.9\work\Tomcat-ForumPass\localhost\forumpass\netmarkets\jsp\netmarkets\view_jsp.java
> D:\jakarta-tomcat-4.1.9\work\Tomcat-ForumPass\localhost\forumpass\netmarkets\jsp\netmarkets\view_jsp.java:961:
> 'else' without 'if'
>          else
>          ^
> An error occurred at line: 264 in the jsp file: /netmarkets/jsp/util/begin.jsp
> 
> Generated servlet error:
> Note:
> D:\jakarta-tomcat-4.1.9\work\Tomcat-ForumPass\localhost\forumpass\netmarkets\jsp\netmarkets\view_jsp.java
> uses or overrides a deprecated API.
> Note: Recompile with -deprecation for details.
> 1 error
> 
> THE SOURCE JSP (a snip of begin.jsp, including the offending line 264)
> --------------
> 259 <BASE HREF="<%=urlFactoryBean.getFullyQualifiedRequestURI()%>"><%
> 260          String ua = request.getHeader("User-Agent").toLowerCase();
> 261 
> 262          if (ua.indexOf("wildfire withtrail")>=0)
> 263              %><SCRIPT LANGUAGE="JavaScript1.2">var is_Wildfire=true</SCRIPT><%
> 264          else
> 265             %><SCRIPT LANGUAGE="JavaScript1.2">var is_Wildfire=false</SCRIPT><%
> 266          // include files containing CSS
> 267          for (Iterator i =
> presentationBean.getData().getCssFiles().iterator(); i.hasNext(); ) {
> 268             String cssFile = (String)i.next();
> 269             %><LINK REL=stylesheet
> HREF="<%=urlFactoryBean.getHREF(cssFile)%>" TYPE="text/css"><%
> 270          }
> 
> THE JASPER2 GENERATED .JAVA (a snip of **/work/**/view_jsp.java, including the
> offending line 961)
> ---------------------------
> 951      out.write("<BASE HREF=\"");
> 952      out.print(urlFactoryBean.getFullyQualifiedRequestURI());
> 953      out.write("\">");
> 954
> 955         String ua = request.getHeader("User-Agent").toLowerCase();
> 956
> 957         if (ua.indexOf("wildfire withtrail")>=0)
> 958                   out.write("<SCRIPT LANGUAGE=\"JavaScript1.2\">var
> is_Wildfire=true");
> 959      out.write("</SCRIPT>");
> 960
> 961         else
> 962                  out.write("<SCRIPT LANGUAGE=\"JavaScript1.2\">var
> is_Wildfire=false");
> 963      out.write("</SCRIPT>");
> 964
> 965         // include files containing CSS
> 966         for (Iterator i =
> presentationBean.getData().getCssFiles().iterator(); i.hasNext(); ) {
> 967            String cssFile = (String)i.next();
> 968                  out.write("<LINK REL=stylesheet HREF=\"");
> 969      out.print(urlFactoryBean.getHREF(cssFile));
> 970      out.write("\" TYPE=\"text/css\">");
> 971
> 972         }
> 
> THE TOMCAT 4.0.3 GENERATED .JAVA (equivalent snip as above, minus the comments)
> --------------------------------
>                 out.write("\">\r\n<BASE HREF=\"");
>                 out.print(urlFactoryBean.getFullyQualifiedRequestURI());
>                 out.write("\">");
>                 
>                          String ua = request.getHeader("User-Agent").toLowerCase();
>                 
>                          if (ua.indexOf("wildfire withtrail")>=0)
>                              
>                 out.write("<SCRIPT LANGUAGE=\"JavaScript1.2\">var
> is_Wildfire=true</SCRIPT>");
>                 
>                          else
> 
>                 out.write("<SCRIPT LANGUAGE=\"JavaScript1.2\">var
> is_Wildfire=false</SCRIPT>");
> 
>                          // include files containing CSS
>                          for (Iterator i =
> presentationBean.getData().getCssFiles().iterator(); i.hasNext(); ) {
>                             String cssFile = (String)i.next();
>                             
>                 out.write("<LINK REL=stylesheet HREF=\"");
>                 out.print(urlFactoryBean.getHREF(cssFile));
>                 out.write("\" TYPE=\"text/css\">");
>                 
> I would guess by looking at the two generated .java listings that 958 and 959
> should be enclosed in braces.
> 
> PS. The performance gains of 4.1.x over 4.0.x are terrific!
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> 
> 




--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message