-
Nov 14th, 2005, 11:51 AM
#1
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
Always Learning
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules