- 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
What is the use of jsp text action element?
The <jsp: text> action can be used to write the template text in JSP pages and documents. Following is the simple syntax for this action −
<jsp:text>Template data</jsp:text>
The body of the template cannot contain other elements; it can only contain text and EL expressions (Note − EL expressions are explained in a subsequent chapter). Note that in XML files, you cannot use expressions such as ${whatever > 0}, because the greater than signs are illegal. Instead, use the gt form, such as ${whatever gt 0} or an alternative is to embed the value in a CDATA section.
<jsp:text><![CDATA[<br>]]></jsp:text>
If you need to include a DOCTYPE declaration, for instance for XHTML, you must also use the <jsp:text> element as follows −
<jsp:text><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">]]></jsp:text> <html> <head> <title>jsp:text action</title> </head> <body> <books> <book> <jsp:text> Welcome to JSP Programming </jsp:text> </book> </books> </body> </html>
Try the above example with and without <jsp:text> action.
- Related Articles
- What is the use of jsp plugin action element?
- What is the use of Action in JSP?
- What is the function of action in JSP?
- How to use action in JSP?
- How to use action in JSP?
- How to use action in JSP?
- How to use Action in JSP?
- How to use Action in JSP?
- What are the different scope values for the JSP action in JSP?
- What is the use of tag in JSP?
- What is the use of tag in JSP?
- What is the use of tag in JSP?
- What is the difference between include action and include directive in JSP?
- What is the use of Cookie or hidden fields in JSP?
- What is the use of page object in JSP? Need an example.

Advertisements