Re: [Htmlparser-user] html code parsing
Brought to you by:
derrickoswald
From: Derrick O. <Der...@ro...> - 2003-03-15 20:59:22
|
Guilherme, I think what you need is in src/org/htmlparser/util/Translate.java Something like this should work: String htmltext = Translate.encode (resultset.getString ("databasetext")); If you have to do a lot of it though, you'll probably want to rewrite that method. As it stands it allocates one Character for each character in the input string. If you do want to rewrite it, you should probably instead adjust the Generate class in the same package since the Translate.java source is created by running Generate. Derrick >To: htm...@li... >Date: Fri, 14 Mar 2003 20:40:12 +0000 (WET) >From: Guilherme Zambon <gz...@sa...> >Subject: [Htmlparser-user] html code parsing >Reply-To: htm...@li... > >Anyone using htmlparser to parse ", <, > from user input to >", < and > ? >I have the following scenario: >my database has texts with these chars (",< and >) and I have to >put them from database to a <textarea> in the html. Is there any >taglib or other solution to I filter this database information, >to show in a html form field? > >Thanks in advance, > >Guilherme Zambon > >Example of code that I need to threat: > ><textarea><%= rs.getString("databasetext") %></textarea> > >it generates something like ><textarea>a text with < won't work in a html</textarea> > >and I want something like ><textarea><sometag:encode string="<%= >rs.getString("databasetext")" /></textarea> > >-- >SAPO ADSL.PT, apanhe já o comboio da Banda Larga. Kit SAPO ADSL.PT €50 > >hTTP://www.sapo.pt/kitadsl > > > |