Announcement Announcement Module
Collapse
No announcement yet.
Java 5 command initializer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java 5 command initializer

    Does anyone know of something that initializes a command object from request where there are arbitrary number of nested and/or indexed elements?
    Something you could put in Object formBackingObject(HttpServletRequest request) that would instantiate nested classses and add indexed elements as necessary? With java 5 you can specify type of collections, so if all command classes were concrete classes rather than interfaces, should be possible. I could write one, but wondered if there was already something like this.

    For example:

    class article
    article.title
    article.author
    article.links

    class author
    author.name

    class link
    link.text
    link.url
    link.newWindow

    request params:

    title=foo
    author.name=Harold

    links[0].text=abcd
    links[0].url=http://abcd.com
    links[0].newWindow=whatever

    links[1].text=abcd
    links[1].url=http://abcd.com
    links[1].newWindow=whatever
Working...
X