You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Fisher, Mitchell L" <Mi...@unisys.com> on 2006/11/09 20:24:36 UTC

JSP Syntax Error

I am trying to modify the snoop.jsp that comes with Tomcat 5.5.20.  I
have the following snippet in my jsp and it compiles fine:

  <tr>
    <td>Path info</td><td><%
out.print(util.HTMLFilter.filter(request.getPathInfo())); %></td>
  </tr>

If I add the following before the above use of getPathInfo, I get syntax
errors on the new code (the old code still does not report any errors):

  <tr>
    <td>Context path</td><td><%=
out.print(util.HTMLFilter.filter(request.getContextPath())); %></td>
  </tr>
  <tr>
    <td>Servlet path</td><td><%=
out.print(util.HTMLFilter.filter(request.getServletPath())); %></td>
  </tr>

The error is:

 org.apache.jasper.JasperException: Unable to compile class for JSP

 An error occurred at line: 43 in the jsp file: /snp/snoop2.jsp
 Generated servlet error:
 Syntax error on token ";", delete this token

 An error occurred at line: 46 in the jsp file: /snp/snoop2.jsp
 Generated servlet error:
 Syntax error on token ";", delete this token

I have not changed anything from the default Jasper configuration.

(Is this the best place to ask this kind of question?)

Mitchell Fisher | Unisys Corp.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JSP Syntax Error

Posted by Dima Retov <di...@axisway.com>.
You have changed

<% to <%=


Thursday, November 9, 2006, 9:24:36 PM, you wrote:

FML> I am trying to modify the snoop.jsp that comes with Tomcat 5.5.20.  I
FML> have the following snippet in my jsp and it compiles fine:

FML>   <tr>
FML>     <td>Path info</td><td><%
FML> out.print(util.HTMLFilter.filter(request.getPathInfo())); %></td>
FML>   </tr>

FML> If I add the following before the above use of getPathInfo, I get syntax
FML> errors on the new code (the old code still does not report any errors):

FML>   <tr>
FML>     <td>Context path</td><td><%=
FML> out.print(util.HTMLFilter.filter(request.getContextPath())); %></td>
FML>   </tr>
FML>   <tr>
FML>     <td>Servlet path</td><td><%=
FML> out.print(util.HTMLFilter.filter(request.getServletPath())); %></td>
FML>   </tr>

FML> The error is:

FML>  org.apache.jasper.JasperException: Unable to compile class for JSP

FML>  An error occurred at line: 43 in the jsp file: /snp/snoop2.jsp
FML>  Generated servlet error:
FML>  Syntax error on token ";", delete this token

FML>  An error occurred at line: 46 in the jsp file: /snp/snoop2.jsp
FML>  Generated servlet error:
FML>  Syntax error on token ";", delete this token

FML> I have not changed anything from the default Jasper configuration.

FML> (Is this the best place to ask this kind of question?)

FML> Mitchell Fisher | Unisys Corp.


FML> ---------------------------------------------------------------------
FML> To start a new topic, e-mail: users@tomcat.apache.org
FML> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
FML> For additional commands, e-mail: users-help@tomcat.apache.org




-- 
Best regards,
 Dima                            mailto:dima@axisway.com



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org