tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zel...@technologist.com
Subject Problem with if and scriplets
Date Tue, 04 Sep 2001 14:58:44 GMT
I have a scriplet that checks security. It looks like this:

<%
  if (!securityBean.check(session)) {
    response.sendRedirect("login?target=JspWithBean.jsp");
    return;
  }
%>

When I convert it to tag:

<jr:if test="<%= !securityBean.check(session) %>">
  <%
    response.sendRedirect("login?target=JspWithBean.jsp");
    return;
  %>
</jr:if>

it throws exception.

If I replace scriplet with plain text, it works fine.

Exception:

A Servlet Exception Has Occurred org.apache.jasper.JasperException: Unable
to compile class for JSP

An error occured between lines: 14 and 15 in the jsp file:
/JspWithBeanTag.jsp

Generated servlet error:
D:\java\rendering\work\_0002fJspWithBeanTag_jsp.java:135: Statement not
reached.
                            out.write("\r\n\t\t");
                            ^
1 error

 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
 at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:528)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:176)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:188)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:458)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:215)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2314)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1000)
 at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1093
)
 at java.lang.Thread.run(Thread.java:484)


Mime
View raw message