Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Quoting and Escape Conventions

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source: JSP Spec 2.0, Section JSP.1.6 (Page No. 1-35, In PDF File page no. is 71)

Quoting in EL Expressions
There is no special quoting mechanism within EL expressions; use a literal ‘${‘ if the literal ${ is desired and expressions are enabled for the page. For example, the evaluation of ${‘${‘} is ‘${‘. Note that ${‘}’} is legal, and simply evaluates to ‘}’.

Quoting in Scripting Elements

A literal %> is quoted by %\>

Quoting in Template Text

A literal <% is quoted by <\%
Only when the EL is enabled for a page (see Section JSP.3.3.2, “Deactivating EL Evaluation”), a literal $ can be quoted by \$. This is not required but is useful for quoting EL expressions.

Quoting in Attributes
Quotation is done consistently regardless of whether the attribute value is a literal or a request-time attribute expression. Quoting can be used in attribute values regardless of whether they are delimited using single or double quotes. It is only required as described below.
A ‘ is quoted as \’. This is required within a single quote-delimited attribute value.
A “ is quoted as \”. This is required within a double quote-delimited attribute value.
A \ is quoted as \\
Only when the EL is enabled for a page (see Section JSP.3.3.2, “Deactivating EL Evaluation”), a literal $ can be quoted by \$. This is not required but is useful for quoting EL expressions.
A %> is quoted as %\>
A <% is quoted as <\%
The entities ' and " are available to describe single and double quotes.


I am not able to understand what is convention for ?? For putting quotes (' or ") around attributes and escape values ??
Can some one explain these with examples or direct me to some valuable resource on net which can explain these with some good examples.
 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
me also looking forward to the replies

well yes I did't find any question in the exam related to Escaping convension. moreover it is not part of the objective, so you can relax at the exam point of view.

 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic