eclipse maven jsp hello world

Eclipse maven jsp hello world: Eclipse provides m2eclipse plugin to integrate Maven and Eclipse together. Steps to create maven java web project in eclipse: In eclipse, click on File menu → New → Maven Project. Select maven-archetype-webapp template to create java project and Click on Next button. Now provide the group Id, artifact Id and … Read more

Categories JSP

JSP lifecycle phases

A JSP page is converted into servlet before service requests. JSP Lifecycle consists of following phases: JSP Page Translation: The container validates the JSP page and parse it to generate the servlet file. JSP Page Compilation: The generated servlet file is compiled into a servlet class. Class Loading: Container loads the generated servlet class into … Read more

Categories JSP

JSP Expression Language

JSP Expression Language provides the facility to access the properties of java bean components or other implicit object. It is introduced in the JSP version 2.0. We can write both arithmetic and logical expressions using JSP Expression Language. Example: test.jsp <html> <head> <title>expression language example</title> </head> <body> <h3>This is an expression language example.</h3> 20 is … Read more

Categories JSP

Custom tag with attributes

Custom tags: Custom tags are the user defined tags. These tags are mainly used for code re-usability. We can define a custom tag with any number of attributes. Let us discuss it with the below example. Example: CustomTagWithAttribute.java import java.io.IOException; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.SimpleTagSupport;   /** * This class is used for defining … Read more

Categories JSP

Custom tags

Custom tags: Custom tags are the user defined tags. These tags are mainly used for code re-usability. Advantages of custom tags: Code re-usability. Scriptlet tags are not needed. How to use custom tag? <prefix:tagname attributeName=attributeValue />   A custom tag may have zero or n attributes. How to create a custom tag? Steps to create a custom tag: … Read more

Categories JSP

JSTL fn:trim() function

The JSTL fn:trim() function returns the input string after removing the all white spaces from both ends of the string. Syntax: String trim(String inputString) Example: test.jsp <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>   <html> <head> <title>fn:trim JSTL function example</title> </head> <body> <c:set var="testString" value=" Hello this is a JSTL function example. … Read more

Categories JSP

JSTL fn:toUpperCase() function

The JSTL fn:toUpperCase() function returns the input string after converting the all characters of the string to upper case. Syntax: String toUpperCase(String inputString) Example: test.jsp <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>   <html> <head> <title>fn:toUpperCase JSTL function example</title> </head> <body> <c:set var="testString" value="Hello this is a JSTL function example."/> Given String: … Read more

Categories JSP

JSTL fn:toLowerCase() function

The JSTL fn:toLowerCase() function returns the input string after converting the all characters of the string to lower case. Syntax: String toLowerCase(String inputString) Example: test.jsp <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>   <html> <head> <title>fn:toLowerCase JSTL function example</title> </head> <body> <c:set var="testString" value="Hello this is a JSTL function example."/> Given String: … Read more

Categories JSP

JSTL fn:subStringBefore() function

The JSTL fn:subStringBefore() function returns a sub string of the input string before a specified string. Syntax: Strung subStringBefore(String inputString, String specifiedString) Example: test.jsp <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>   <html> <head> <title>fn:substringBefore JSTL function example</title> </head> <body> <c:set var="testString" value="Hello this is a JSTL function example"/> Given String: <br/> … Read more

Categories JSP

JSTL fn:subStringAfter() function

The JSTL fn:subStringAfter() function returns a sub string of the input string after a specified string. Syntax: Strung subStringAfter(String inputString, String specifiedString) Example: test.jsp <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>   <html> <head> <title>fn:substringAfter JSTL function example</title> </head> <body> <c:set var="testString" value="Hello this is a JSTL function example."/> Given String: <br/> … Read more

Categories JSP