aspose file tools*
The moose likes Struts and the fly likes update a select box in jsp... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "update a select box in jsp..." Watch "update a select box in jsp..." New topic
Author

update a select box in jsp...

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I have a select box... I need to update it with values which are there in an ArrayList in action class...

In my action class i have the values ready but they are not updated in jsp drop-down

I have a question...

1) Should execute method return success for this?? We are not going to a new page so why should we return something?
Anyways,I am returning success and in the mapping I am specifying the same jsp name in result tag...

I want to know what does the framework do when it encounters an ArrayList in action class which matches the name mentioned in the s:iterator written for the select in jsp because I am unable to track in-between processing...

The values are being diaplayed in action class and the drop down is somehow empty...
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Can you show the relevant excerpts of the Action class and the JSP page. Also try to mention the struts version you are using, you must be using Struts 2 (guessing from when you said s:iterator), but exactly which version (as there are changes in different version like the id attribute of s:iterator tag has been replaced by var attribute)...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
Ankit Garg wrote:Can you show the relevant excerpts of the Action class and the JSP page.


I think you'll find them here!


OCJP 6 (93%)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: update a select box in jsp...