Results 1 to 3 of 3

Thread: Command Object - Can I map names of form variables?

  1. #1
    Join Date
    Sep 2005
    Posts
    9

    Default Command Object - Can I map names of form variables?

    I have a form that's coming from a different system that I have no control over. It uses dashes in the names of it's form variables I have to accept with my Spring Controller. Since Java won't let me use dashes in the setter methods of my command object bean, I'm looking for a way to map/convert them to a name without dashes. My searching has turned up nothing useful. Thanks.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    Hmm. Interesting problem.

    I would attack this in one of two ways, either create a filter which uses a HttpServletRequestWrapper and "translates" all the request parameters, or create your own ServletRequestDataBinder and override the creation of PropertyValues.

    I think I prefer the Filter because it is more discrete/transparent.

    HTH.

  3. #3
    Join Date
    Sep 2005
    Posts
    9

    Default

    Good suggestions. Thank you very much.

Similar Threads

  1. Replies: 3
    Last Post: Jun 8th, 2010, 03:27 AM
  2. Replies: 6
    Last Post: Sep 22nd, 2006, 09:08 AM
  3. Replies: 9
    Last Post: May 4th, 2006, 09:53 AM
  4. Replies: 0
    Last Post: Jun 10th, 2005, 08:22 AM
  5. Trouble with form input names
    By robinhyman in forum Web
    Replies: 4
    Last Post: Oct 22nd, 2004, 11:33 AM

Posting Permissions

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