The JSTL library to be included to your web application depends on the version of Servlet you are using. The steps mentioned here lets you choose the right JSTL library version and include it to your web application. We continue from the previous post where we built the web application.
Locating Servlet version
- Open web.xml file located in WEB-INF folder.
- Check the version attribute of web-app tag. Here, the version is 2.5.
Downloading JSTL package depending upon the version
Refer this link to know which version you would need to download depending upon your Servlet version. You will find the download link for each version. I downloaded javax.servlet.jsp.jstl-1.2.1.jar as I have 2.5 version.
Using JSTL in your application
- Create a lib folder under WEB-INF.
- Copy the downloaded jar file into the lib folder.
- Include library to your JSPs and start using it. Here I have modified the existing function to use JSTL tag.
Source
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!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=UTF-8"> <title>Hello World</title> </head> <body> <%-- Object message = request.getAttribute("message"); if (message == null) { %> <form action="sayHello" method="post"> <input type="submit" value="Submit" /> </form> <%[ } else { %> <%=message%> <% } --%> <c:if test="${empty message}"> <form action="sayHello" method="post"> <input type="submit" value="Submit" /> </form> </c:if> <c:if test="${not empty message}"> <c:out value="${message}" /> </c:if> </body> </html>
Interesting Article
ReplyDeleteJava Training in CHennai | Online Java Training
Great Article android based projects
DeleteJava Training in Chennai
Project Center in Chennai
Java Training in Chennai
projects for cse
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Great post. This is very useful. Thanks for sharing.
ReplyDeleteppc training in chennai
Excellent post! Thanks for sharing such a useful post.
ReplyDeleteweb design training in chennai
Normal website design only suitable for desktop screen and it does not appear on new devices like Smart phone and tablets etc. www.exza.my
ReplyDeleteIt speeds up the development and lets you write logical blocks in fewer lines.web design tips
ReplyDeleteIndeed, even the words like charming and intriguing can't do full equity with regards to depicting this blog.
ReplyDeletee-commerce website
great
ReplyDeleteThe writer, through this blog, has earned respect from many for all the right reasons.
ReplyDeletesoftware development company in delhi
Thanks to you friend for your unforgettable blog describing the need of the hour.
ReplyDeleteDigital Marketing Course In Chennai|Digital Marketing Training Institute In Chennai|SEO Training In Chennai
I've proper selected to build a blog, which I hold been deficient to do for a during. Acknowledges for this inform, it's really serviceable!
ReplyDeletemason soiza
Hi,
ReplyDeleteReally appreciate to the admin for providing the great efforts with unique content. I am waiting for your post again soon.
Unix Training in Chennai
Unix Course in Chennai
Excel Training in Chennai
Corporate Training in Chennai
Oracle Training in Chennai
Oracle DBA Training in Chennai
Pega Training in Chennai
Unix Training in Chennai
Unix shell scripting Training in Chennai
Very nice post with lots of information. Thanks for this updates.
ReplyDeleteui ux design course in Chennai
ui ux designer course in Chennai
ui ux course in chennai
ReactJS Training in Chennai
Web Designing Course in chennai
web designing training in chennai
Tally course in Chennai
ui ux design course in Porur
ui ux design course in Tambaram
ui ux design course in Adyar
thanks for your information really good and very nice web design company in velachery
ReplyDelete
ReplyDeleteYou write this post very carefully I think, which is easily understandable to me. Not only this, but another post is also good. As a newbie, this info is really helpful for me. Thanks to you.
Tally ERP 9 Training
tally classes
Tally Training institute in Chennai
Tally course in Chennai
You are providing a post is very useful for develop my knowledge and I learn more info from your blog.
ReplyDeleteDigital Marketing Course In Kolkata
Web Design Course In Kolkata
SEO Course In Kolkata
Great Blog to read,Its gives more useful information.Thank lot.
ReplyDeleteBig Data Training Institute in Pune
Hadoop Training in Pune
Learned a lot of new things in this post. Thanks for taking the time to share this blog..
ReplyDeletecloud computing jobs
uipath jobs for freshers
social media marketing certification
hadoop interview questions and answers
interview questions node js
Fantastic blog! Thanks for sharing a very interesting post, I appreciate to blogger for an amazing post.
ReplyDeleteData Science Course in Pune
Python Classes in Pune
This is great, thanks for the share. Also, visit our website if you are looking to purchase logo:
ReplyDeletePurchase A Logo
I feel good about your share.
ReplyDeleteIt's very helpful for me and I am so happy to see your blog.
Thank you for sharing it with us.
Law essay help