0

Hi,
I am learning JSP now. The following program doesn't work in my Linux system's Mozilla firefox. Any help to fix this problem is appreciated.

<html>
<title>Using JSP EL Operators</title>
<body>
<h2> Using JSP EL Operators</h2>
<table border ="2">
<tr> <td> 13 + 2 = ${13 + 2} </td> </tr>
<tr> <td> 13 - 2 = ${13 - 2} </td> </tr>
<tr> <td> 13 * 2 = ${13 * 2} </td> </tr>
<tr> <td> 13 / 2 = ${13 / 2} </td> </tr>
<tr> <td> 13 % 2 = ${13 % 2} </td></tr>
<tr> <td></td> </tr>
<tr> <td> 13.24 + 2 = ${13.24 + 2} </td> </tr>
<tr> <td> 13.24 - 2 = ${13.24 - 2} </td> </tr>
<tr> <td> 13.24 * 2 = ${13.24 * 2} </td> </tr>
<tr> <td> 13.24 / 2 = ${13.24 / 2} </td> </tr>
<tr> <td></td> </tr>
<tr> <td> true and false = ${true && false} </td></tr>
<tr> <td> true or false = ${true || false} </td></tr>
<tr> <td> not false = ${! false} </td></tr>
</tr>
</table>
</body>
</html>

Here expressions like ${13+2}, ${true && false} etc. are not evaluated, but displayed as given in code.

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by vsanandan
0

On Tomcat, there are (only?) two possible reasons: invalid schema in web.xml, or el-ignored config option.

Set isELIgnored="false" attribute.

<%@ page isELIgnored="false" %>
.....
1

> The following program doesn't work in my Linux system's Mozilla firefox.
> Any help to fix this problem is appreciated

This isn't a browser problem. Make sure that your page which hosts EL snippets has an extension of .jsp and not .html . The container serves HTML pages as static content instead of running them through the entire JSP life-cycle [translate-> compile -> load -> instantiate].

0

On Tomcat, there are (only?) two possible reasons: invalid schema in web.xml, or el-ignored config option.

Set isELIgnored="false" attribute.

<%@ page isELIgnored="false" %>
.....

Even the above suggested solution is not working and I get a status error:

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: /pjbank-1/operators.jsp(0,0) Page directive has invalid attribute: isELIgnored
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:49)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:383)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:174)
at org.apache.jasper.compiler.JspUtil.checkAttributes(JspUtil.java:287)
at org.apache.jasper.compiler.Validator$PageDirectiveVisitor.visit(Validator.java:85)
at org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:235)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1000)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1042)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1048)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:187)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1000)
at org.apache.jasper.compiler.Validator.validate(Validator.java:537)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:355)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:142)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:139)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2460)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:119)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:157)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:534)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.