Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sanitizing input from forms

 
Wilson Gordon
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an existing library that we can use in the servlets to sanitize user inputs from forms, such as removing javascripts, HTML codes, etc?

Thanks.
 
Dan Howard
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. It's called Struts. Struts matches inputs from form into Java Beans -as well as other things

http://struts.apache.org/
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does that have to do with the question? Struts will do nothing to "sanitize" the input.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the many things bound in with Struts is the commons/validator component.

I don't know if this component has the ability to remove HTML/Javascript from form fields or not but you certainly don't need to adopt an entire (massive) framework just to use it.

http://jakarta.apache.org/commons/validator/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!