Q1:
Look at OSCore from Opensymphony:
http://www.opensymphony.com/oscore/

Specifically, the plainTextToHtml method in the TextUtils class: http://www.opensymphony.com/oscore/api/com/opensymphony/util/TextUtils.html#plainTextToHtml(java.lang.String)

This does exactly what Andrew mentions, plus it takes care of line breaks.


Andrew Hill wrote:


Other alternative is similar - convert the < and > to &lt; and &gt; etc...
so it outputs as though it was text.

-----Original Message-----
From: Brian McSweeney [mailto:[EMAIL PROTECTED]
Sent: Monday, 14 July 2003 18:38
To: 'Struts Users Mailing List'
Subject: RE: two little questions


Hi Simon, That was my original idea too. Just wanted to see if other people were doing the same.

Cheers,
Brian

-----Original Message-----
From: Simon Kelly [mailto:[EMAIL PROTECTED]
Sent: 14 July 2003 10:58
To: Struts Users Mailing List
Subject: Re: two little questions

For Q1.

You could pass the data that they enter through a paser, that delimits
out
the <...> tags by placing '!--' after any '<' and '--' before and '>',
this
will stop this text being viewed as html. Or jusr remove the tags or
allow
cetain tags and remove any that aren't in the allowable ones!

Cheers

Simon

----- Original Message -----
From: "Brian McSweeney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 14, 2003 11:49 AM
Subject: two little questions




Question1:

If my application allows users to enter text which will then later be
displayed on
web pages, do I have to ensure that the text they write isn't html.


For


example,
lets say a message board application. If a user enters in loads of


text


which is
html, will this not mess up the page when it is displayed? If so, how


do


people
check for this.

Question2:

If I want my app to be able to allow users to enter text in any


language


- eg,
multi-lingual message boards, do I have to configure my database to be
able to
handle multiple language types, or should it just work.

Thanks for any replies,
Brian






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




Reply via email to