Showing posts with label Simple Payroll Program in JSTL. Show all posts
Showing posts with label Simple Payroll Program in JSTL. Show all posts

Sunday, May 29, 2016

Simple Payroll Program in JSTL

A simple program that I wrote using JSTL or Java Server Pages Standard Tag Library that will ask the user to give the number of days work of the employee and then it will ask the rate per day and then our program will compute the salary of the employee. The code is very simple and easy to understand.

 Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360



Sample Program Output


Program Listing

payroll.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Simple Payroll Program in JSTL</title>
</head>
<style>
body 
{
font-family:arial;
font-weight:bold;
size:12px;
color:blue;
}
</style>
<body>
  <h2> Simple Payroll Program in JSTL</h2>
  <br>
  <form method="post">
     Enter Number of Days Work &nbsp; &nbsp;
    <input type="text" name="days"  size="3" value="<c:out value="${param.days}"/>" autofocus/><br>
    Enter Rate Per Day&nbsp; &nbsp;
    <input type="text" name="rate"  size="3" value="<c:out value="${param.rate}"/>"/>
   <br> <br>
     <input type="submit" value="Compute Salary"
     title="Click here to findout the salary of the employee." />
     <br />
    </form>
<c:if test="${pageContext.request.method=='POST'}">
 <c:set var="salary" scope="session" value="${param.days * param.rate}"/>
 <br>
Your salary is $<c:out value="${salary}"/>.
</c:if>
</body>
</html>