954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How To Filter Invalid(vulgar) words in JSP

How To Filter Invalid(vulgar) words in JSP?
when data was entered to a textbox it must not contain vulgar or bad words.The event is processed before data is saved and posted.
Do I need to specify each word or there are some shortcuts for it?
Can you give me a concrete example..tnx a lot!!!

javagurlush
Newbie Poster
3 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

usually you have a list of words and check each word against that list.
There are more advanced systems that do full lexical analysis to also take context into account but you're not ready for those.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

can you please giv me a brief example?tnx...

javagurlush
Newbie Poster
3 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

jUST wanna share you what I've got due to extensive web research:) ..Visit this site, it really fits well to my needs:

http://javascript.internet.com/forms/word-filter.html

knowledge is learned through acceptance
javagurlush
Newbie Poster
3 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

If you happy with JavaScript why not...

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

>>Visit this site, it really fits well to my needs:
Ok, so it won't accept the word "bloody" but it will accept "f***k". Some crappy filter that is :) bloody is not a naughty word but the other is.

Ancient Dragon
Retired & Loving It
Team Colleague
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Well you need to maintain the array of rude words, they provided only 3 words in their example var swear_words_arr=new Array("bloody","war","terror");

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You