[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglibs-user
Subject:    Re: Newlines in attributes
From:       Glenn Nielsen <glenn () voyager ! apg ! more ! net>
Date:       2002-01-31 1:42:45
[Download RAW message or body]

The JSP 1.2 spec describes attributes in section 2.3.5.

It starts with "Following the XML specification ..."
States what the quote characters are for delimiting an attribute.
State how to escape a few special characters.  But gives no further
guidance that I can find.

Now that a JSP page can be represented as XML I would think that
an attribute declaration would have to meet the requirements
for an XML attribute declaration in addition to using the
explicit character escapes listed by the JSP 1.2 spec.

It would be an interesting test to create a series of small
JSP pages which test the use of different characters within
an attribute, then run these in different servlet containers 
to determine if they all behave the same way.

Regards,

Glenn

bayard@generationjava.com wrote:
> 
> In my example for the string-taglib, I stupidly gave an example of:
> 
>  <str:replace replace="\n" with="<br>\n"><db:get value="data"></str:replace>
> 
> without testing. Where db:get is a hypothetical tag creating data.
> The example doesn't work because the \n in the tag gets turned into a
> normal 'n' before it hits the Tag object.
> 
> Is there a way to solve this that I am missing?
> 
> Sending:   "\\n" just sends through what you'd expect, \ and n.
> And sending:  "&#92n" does just the same.
> 
> I assume that a \t and \b etc won't work either. So my current solution is
> an attribute to my tag which says to treat any \n's as being real newlines
> and not the characters \ and n. Seems a bit painful though. Or a new tag.
> 
> Bay
> 
> --
> To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>

-- 
----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic