File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Setting Name and ID inside loop Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Setting Name and ID inside loop" Watch "Setting Name and ID inside loop" New topic
Author

Setting Name and ID inside loop

Joe Brigs
Ranch Hand

Joined: Jun 06, 2011
Posts: 52

I have a Array thats populated from a Database, can be 1 to many occurrences. I want to use it to populate a dropdown box , it wil be the "Selected" value thats seen on the screen, but its an update screen so user can change from 3 other options. How do I set the name and id to be diffrent for each occurrence, so I can use name in servlet to do DB update. The last code I tried ==> name="'upsLoc1'+j" obviously didn't work. I'm sure its simple , but I'm blind. Thanks for help

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 13842

I haven't used scriptlets for years, but if your organization is still mired in the past and is stuck using them, wouldn't that just be
Joe Brigs
Ranch Hand

Joined: Jun 06, 2011
Posts: 52

Paul, Thanks that was correct very obvious I should have known that. And yes were still using scriplets. I started using JSTL tags but my mentor prefers scriplets and this is my 1st Java Project. Thanks again
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

Joe Brigs wrote:but my mentor prefers scriplets


Does he also prefer stone knives and bear skins? He's mired 10 years in the past. Be aware of this and don't let it deter your own advancement.
 
 
subject: Setting Name and ID inside loop
 
Threads others viewed
Help me to have a sortable table in my html profile!
get the selected value of dropdown box when button is clicked in row
spaces while populating using s:iterator
struts-2 (set values to action class)
How to update a image using servlet?
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture