- Create Web Application.
- Add standard.jar and jstl.jar in lib folder under WEB-INF.
- Add a taglib directive to the jsp page on which you want to use JSTL as
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> - The page is now configured to use JSTL library
Example is:-
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Enter credentials to Login</title>
</head>
<body>
Values is <c:out value="${param.userType}" /> here
</body>
</html>
No comments:
Post a Comment