File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Advance Java Indexed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Advance Java Indexed" Watch "Advance Java Indexed" New topic

Advance Java Indexed

Vijay Aneraye

Joined: Sep 03, 2008
Posts: 8
Hello All,
I have my jsp with indexed of checked box,

<logic:iterate id="productVO" name="subscriptionForm" property="productsList">
<html:checkbox property="productId" name="productVO" ></html:checkbox>

This is my Form Bean.
public class SubscriptionForm extends ActionForm

private ProductsType[] productsList;

* @return Returns the productsList.
public ProductsType[] getProductsList() {
return productsList;

* @param productsList The productsList to set.
public void setProductsList(ProductsType[] productsList) {
this.productsList = productsList;

And this is
public class ProductsType
private int productId;

* @return Returns the productId.
public int getProductId()
return productId;
* @param productId The productId to set.
public void setProductId(int productId)
this.productId = productId;
After submitting the form I want the all the selected productIds in to action, so I have written the core in Action of submit
ProductsType[] productType=subscriptionForm.getProductsList();
for(int i=0;i<productType.length;i++){
ProductsType proType=productType[i];


SO every time I am getting null value for productType, is someting wrong ? Please Help me.

Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
In your html source, what the names that are generated for the checkbox fields? I think you need to use nested:iterate and nested:checkbox.
I agree. Here's the link:
subject: Advance Java Indexed
jQuery in Action, 3rd edition