- 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
I want to use %> literal in JSP page. But it is throwing error. How to escape this syntax in JSP?
You can escape it using backslash character. Replace %> with %/>. Following example showcases the same.
<html> <head> <title>A Comment Test</title> </head> <body> <h2>Syntax: <\%= (new java.util.Date()).toLocaleString() %\></h2> <p>Today's date: <%= (new java.util.Date()).toLocaleString()%></p> </body> </html>
- Related Articles
- How to create a common error page using JSP?
- I want to create a custom tag in JSP. How to write a custom tag in JSP?
- How to avoid Java code in jsp page?
- 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?
- How can I create custom tag in JSP which can accept attribute from parent jsp page?
- How to write a comment in a JSP page?
- How to use a filter in JSP?
- How to use resource bundle in JSP?
- What is JSP page redirection?
- What is a page object in JSP?
- What is a page directive in JSP?

Advertisements