Results 1 to 3 of 3

Thread: htmlEscape and databinding

  1. #1
    Join Date
    Dec 2004
    Posts
    3

    Default htmlEscape and databinding

    How do you handle the case where you want user input from a form to be htmlEscape'd when you are binding to a command object? Looks like I'm going to override createBinder in my controller and return my own subclass of ServletRequestDataBinder which simply overrides the bind method and simply htmlEscapes the MutablePropertyValues. A simple implementation would escape every request parameter. Perhaps a little inefficient but oh well. Any ideas?

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    How do you handle the case where you want user input from a form to be htmlEscape'd when you are binding to a command object?
    Are you sure you want to do this? Usually you HTML escape raw data only when displaying via HTML.

  3. #3
    Join Date
    Dec 2004
    Posts
    3

    Default

    i know, it's normally unnecessary, but in this case it is a requirement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •