jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rusty Lowrey" <rustylow...@earthlink.net>
Subject Proposal For Addition of org.apache.taglibs.string.EscapeAsciiTag
Date Tue, 18 Mar 2003 01:09:14 GMT
Proposal For Addition of org.apache.taglibs.string.EscapeAsciiTag

I) Motivation
This tag library converts any string enclosed within its body into proper
ascii format for display in a browser. Special characters such as &, <, >,
", ', copyright symbols, registered trademark symbols, special characters
for other languages with accents, etc... (full list -
http://www.ramsch.org/martin/uni/fmi-hp/iso8859-1.html) do not always
display properly within a jsp or html page. These characters must be escaped
to the ascii equivalents such as &amp;, &lt;, &gt;, &quot; &#169, etc...
to
display properly.

An example might be text containing double-quotes that must be included as a
jsp or html attribute.

This tag library also allows display of raw html or xml code within a
browser.

Also, this tag library can be used when a user submits text from a form that
may have been copied and pasted from Microsoft Word. Word generates many
special characters including smart quotes, middle dots and ellipses that may
not display properly in the browser.

This tag library could also be used to escape the single quote character
within SQL code. I believe that the <sql:escapeSql> tag already does this
though.

II) Overview
This JSP code:

<str:escapeAscii>Test "" <&> ©®</str:escapeAscii>

would be converted to:

Test &quot;&quot; &lt;&amp;&gt; &#169;&#174;

which would display properly in the browser as:

Test "" <&> ©®



Display HTML code such as:

<str:escapeAscii><html><head><title>Test</title></head><body>Test</body></ht
ml></str:escapeAscii>

would be converted to:

&lt;html&gt;&lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;/head&gt;&lt;body
&gt;Test&lt;/body&gt;&lt;/html&gt;

which would display properly in the browser as:

<html><head><title>Test</title></head><body>Test</body></html>



Also display XML code in the same manner.

III) Requirements
JSP 1.1 compatible - no outside dependencies

IV) Commitment
I am willing to assume the role of committer. The code is already written
and has been tested locally.

Thanks,

Rusty Lowrey
rustylowrey@earthlink.net


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message