i develop ecomerce site in that user can get category wise product when on home page all product display then click on image then query string pass and the detail displayed but when in same description want when data is filter by category then following error comes java.lang.NumberFormatException: null
Product Bean
public String singledispp(int pid)
{
ProductTbl p=ad.searchproduct(pid);
product_id=p.getProductId();
return "/client/single.xhtml?faces-redirect=true&product_id="+product_id;
}
public String dispbycat(int cid)
{
CategoryTbl ct=(CategoryTbl)ad.searchcat(cid);
category_id=ct.getCategoryId();
return "/client/products.xhtml?faces-redirect=true&categoryId="+category_id;
}
public Collection<ProductTbl> getproductbyid()
{
Map<String,String> params =FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap();
String parameterOne = params.get("product_id");
int foo = Integer.parseInt(parameterOne);
return ad.getAllProductByProductid(foo);
}
public Collection<ProductTbl>getbycat()
{
Map<String,String> params =FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap();
String parameterOne = params.get("categoryId");
int foo = Integer.valueOf(parameterOne);
dispbycat(foo);
return ad.getbycategoryid(foo);
}