Swimming with the Razorfishes

Friday, October 21, 2005

Here is one for the geeks.

I just had to throw together a JSP that serves as kind of a proofing report for a publishing function. The dynamic information in the JSP is coming from a database; the source of the data is human beings typing into an application.

The JSP is creating a UTF-8 encoded validated XHTML page.

Because it is valid XHTML, I have to be careful with the dynamic content. People may be typing in things like & or < -- these characters obviously need to be encoded as entities.

Is there some utility in the standard JSP library, J2EE, or the Struts distribution that does this? This is page content that needs to be encoded, not a URL. I feel like a dumbass for not knowing this.

0 Comments:

Post a Comment

<< Home