Friday, February 3, 2012

Using JSTL in Web Application

  1. Create Web Application. 
  2. Add standard.jar and jstl.jar in lib folder under WEB-INF.
  3. 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" %>
  4. 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

SpringBoot Application Event Listeners

When a spring boot application starts few events occurs in below order ApplicationStartingEvent ApplicationEnvironmentPreparedEvent Applicat...