- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to remove a java variable from current scope in JSP?
The <c:remove> tag removes a variable from either a specified scope or the first scope where the variable is found (if no scope is specified). This action is not particularly helpful, but it can aid in ensuring that a JSP cleans up any scoped resources it is responsible for.
Attribute
The <c:remove> tag has the following attributes −
Attribute | Description | Required | Default |
---|---|---|---|
var | Name of the variable to remove | Yes | None |
scope | Scope of the variable to remove | No | All scopes |
Example
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %> <html> <head> <title><c:remove> Tag Example</title> </head> <body> <c:set var = "salary" scope = "session" value = "${2000*2}"/> <p>Before Remove Value: <c:out value = "${salary}"/></p> <c:remove var = "salary"/> <p>After Remove Value: <c:out value = "${salary}"/></p> </body> </html>
The above code will generate the following result −
Before Remove Value: 4000 After Remove Value:
- Related Articles
- How variable scope works in Python function?
- How does variable scope work in python?
- How to pass a date variable in sql query in a JSP?
- PHP Variable Scope
- How does JavaScript Variable Scope work?
- How to print current date and time in a JSP page?
- What are the different scope values for the JSP action in JSP?
- How to use a value of XPath expression result in JSP in a variable?
- Explain scope of a variable in C language.
- How to remove a SubList from an ArrayList in Java?
- How to remove menus from MenuBar in Java?
- How to remove element from ArrayList in Java?
- How to remove an element from a Java List?
- How to remove the last character from a string in Java?
- Explain how to remove Leading Zeroes from a String in Java

Advertisements