Free Data Structures and Algorithms Course









Subscribe below and get all best seller courses for free !!!










OR



Subscribe to all free courses

How to use Arithmetic Operations in Expression Language ( el ) in a simple jsp page ?.

A simple jsp to demonstrate how to use Arithmetic Operations in Expression Language ( el ).

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body style="background-color: lightblue">
        <h2>Arithmetic Operations with EL !</h2>
        
        <table border="2">
            <thead>
                <tr>
                    <th>Operation</th>
                    <th>EL Expression</th>
                    <th>Result</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Digit</td>
                    <td>\${8}</td>
                    <td>${8}</td>
                </tr>
                <tr>
                    <td>Addition</td>
                    <td>\${4+4}</td>
                    <td>${4+4}</td>
                </tr>
                <tr>
                    <td>Addition</td>
                    <td>\${5.5+4.5}</td>
                    <td>${5.5+4.5}</td>
                </tr>
                <tr>
                    <td>Subtraction</td>
                    <td>\${15-5}</td>
                    <td>${15-5}</td>
                </tr>
                <tr>
                    <td>Division</td>
                    <td>\${20/4}</td>
                    <td>${20/4}</td>
                </tr>
                <tr>
                    <td>Multiplication</td>
                    <td>\${2*4}</td>
                    <td>${2*4}</td>
                </tr>
                <tr>
                    <td>Modulus</td>
                    <td>\${21%4}</td>
                    <td>${21%4}</td>
                </tr>
            </tbody>
        </table>        
    </body>
</html>



Output of the Jsp Page :



 
© 2021 Learn Java by Examples Template by Hubberspot