aspose file tools*
The moose likes Struts and the fly likes dynamic parameter names Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynamic parameter names" Watch "dynamic parameter names" New topic
Author

dynamic parameter names

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Hello:

I have an HTML form on which there can, in theory, be an infinite number of checkboxes (Users are selecting files from a tree and there is no telling how many will be selected). The name of each checkbox is determined at runtime (= to the path of the file). That being the case, how can I set up an action to read these parameters? Or do it need to go back to the servlet API?

Thanks.
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
This is Strut 2 by the way (2.0.11.1)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

Regardless of using Struts or not, have you considered using the same name for them all with unique values? That makes them a lot easier to retrieve on the server.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Have another beer, Hamacher.

I assume in struts 2 this property would map to an array within the action.

Thank you very much!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic parameter names