JSTL c:remove Core Tag

The JSTL <> Core Tag is used to remove a variable from a specific scope.

Syntax: <c:remove var=”varName”/>

c:remove tag attributes:

Attribute Description Required
var It specify the name of the variable to be removed. Yes
scope It specify the scope of the variable to be removed. No

Example:

test.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 
<html>
  <head>
	<title>c:remove JSTL core tag example</title>
  </head>
  <body>
    <c:set var="website" value="www.javawithease.com"/>
    Before removing the variable value:<c:out value="${website}"/><br/>
    <c:remove var="website"/>
    After removing the variable value:<c:out value="${website}"/>
  </body>
</html>

web.xml

<web-app>
 
  <welcome-file-list>
          <welcome-file>test.jsp</welcome-file>
  </welcome-file-list>	
 
</web-app>

Output:

jsp example 33
 
Download this example.
 
Next Topic: JSTL c:catch Core Tag with example.
Previous Topic: JSTL c:set Core Tag with example.

Related Topics:

JSTL c:out Core Tag with example.
JSTL c:set Core Tag with example.
JSTL c:remove Core Tag with example.
JSTL c:catch Core Tag with example.
JSTL c:if Core Tag with example.
JSTL c:choose , c:when and c:otherwise Core Tags with example.
JSTL c:import Core Tag with example.
JSTL c:forEach Core Tag with example.
JSTL c:forTokens Core Tag with example.
JSTL c:url Core Tag with example.
JSTL c:param Core Tag with example.
JSTL c:redirect Core Tag with example.