Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions? | Software Development
 

EL Basic Comparisons

EL means the expression language , it makes it possible to easily access application data stored in JavaBeans components.

EL Basic Comparisons

                          

EL means the expression language , it makes it possible to easily access application data stored in JavaBeans components. The jsp expression language allows a page author to access a bean using simple syntax such as $(name).  Before JSP 2.0, we could  use only  a scriptlet, JSP expression, or a custom tag to include server state in the jsp page output. Expression Language (EL) was first introduced in JSTL 1.0. EL makes it easier to integrate server side state with the presentation output. 

EL expression is always written between the delimiters ${ and }. In the JSP page response, the result of expression evaluation replaces the expression and its delimiters in the template text. Within tags, expression can be used only in attribute values.

The Expression Language has the following Basic Comparisons:

< >   <=   >=       lt   gt le  ge

= =    !=     eq  ne

&&       and

||    or

The code of the program is given below:

 

<html>
<head>
<title>Basic Comparisons</title>
</head>
<body>
<h1>Basic Comparisons</h1>
<hr>
In EL the following comparison operators are supported:
<ul>
<li>Less-than (&lt; or lt)</li>
<li>Greater-than (&gt; or gt)</li>
<li>Less-than-or-equal (&lt;= or le)</li>
<li>Greater-than-or-equal (&gt;= or ge)</li>
<li>Equal (== or eq)</li>
<li>Not Equal (!= or ne)</li>
</ul>
<blockquote>
<u><b>Numeric</b></u>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>\${5 &lt; 7}</td>
<td>${5 < 7}</td>
</tr>
<tr>
<td>\${5 lt 7}</td>
<td>${5 lt 7}</td>
</tr>
<tr>
<td>\${4 &gt; (6/2)}</td>
<td>${4 > (6/2)}</td>
</tr>
<tr>
<td>\${4 &gt; (6/2)}</td>
<td>${4 > (6/2)}</td>
</tr>
<tr>
<td>\${6.0 &gt;= 3}</td>
<td>${6.0 >= 3}</td>
</tr>
<tr>
<td>\${6.0 ge 3}</td>
<td>${6.0 ge 3}</td>
</tr>
<tr>
<td>\${4 &lt;= 3}</td>
<td>${4 <= 3}</td>
</tr>
<tr>
<td>\${4 le 3}</td>
<td>${4 le 3}</td>
</tr>
<tr>
<td>\${2.0 == 2}</td>
<td>${2.0 == 2}</td>
</tr>
<tr>
<td>\${2.0 eq 2}</td>
<td>${2.0 eq 2}</td>
</tr>
<tr>
<td>\${(10*10) != 100}</td>
<td>${(10*10) != 100}</td>
</tr>
<tr>
<td>\${(10*10) ne 100}</td>
<td>${(10*10) ne 100}</td>
</tr>
</table>
</code>
</blockquote>
</body>
</html>

The output of the program is given below:

Download this example:

                          

» View all related tutorials
Related Tags: java c library error ide io vi core tag lock this id action block write invoke like handle if solution

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.