File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts Indexed html:checkebox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Indexed html:checkebox" Watch "Struts Indexed html:checkebox" New topic

Struts Indexed html:checkebox

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 geeting null value for productType, is someting wrong? Please Help me.

I agree. Here's the link:
subject: Struts Indexed html:checkebox
It's not a secret anymore!