[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Home]
Re: Adding a new tag to JSP.
Hi, Paul,
>
> I don't like deviating from the standard.
> How about making a better htmlencoder?
> one that does a check for "evil" characters before creating the new
> stringbuffer?
>
1. You do not need a StringBuffer, you can write characters directly to out
by using out.print
2. You usually need both type of outputs:
with and without escaping. For example many things (like element construction sets)
output data in HTML. You do not want to escape it.
3. As it is now the best way to do escape is to write a method like escape(java.io.PintWriter out,String s)
which escapes symbols and prints them directly to out.
and use it like <% escape(out,variable_name); %>
4. Sun's standard is brain dead anyway.
For example the only way you can print HTML from a custom function
(not service method) is to use out.println() method
unless you use one of the tricks outside of JSP standard.
SUNs standard (without special tricks ) leads to
the business logic determined by HTML, not HTML is determined by
business logic as it should be.
Try to write in JSP a static method which outputs a complex data structure to HTML.
You have no way to do this in SUNs brain dead standard.
Vladislav