3d商店系统!利用jsp和3d结合制作!
源代码在线查看: relative.jsp
List topCategories = new ArrayList();
for (int i = 0; i < categories.size(); i++) {
Category c = categories.get(i);
if (c.getGrade() == 1) {
topCategories.add(c);
}
}
return topCategories;
}
private List getChilds(Category parent, List categories) {
List childs = new ArrayList();
for (int i = 0; i < categories.size(); i++) {
Category c = categories.get(i);
if (c.getPid() == parent.getId()) {
childs.add(c);
}
}
return childs;
}
private String getChildsStr(List childs) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < childs.size(); i++) {
Category c = childs.get(i);
buf.append(
"")
.append(c.getName()).append("").append("-");
}
return buf.toString();
}%>
List categories = CategoryService.getInstance()
.getCategories();
List topCategories = getTopCategories(categories);
%>
businessSell
function changeDrop2() {
if (document.form.Drop1.selectedIndex == 0) {
document.form.Drop2.length = 1;
document.form.Drop1.selectedIndex = 0
document.form.Drop2.selectedIndex = 0
document.form.Drop2.options[0].text = "No Top Category Selected";
document.form.Drop2.options[0].value = "No Top Category Selected";
}
if (document.form.Drop1.options[document.form.Drop1.selectedIndex].value == ) {
List childs = getChilds(top, categories);
int i = 1;
%>
document.form.Drop2.length = ;
document.form.Drop2.selectedIndex = 0
document.form.Drop2.options[0].text = "Select Second Category";
document.form.Drop2.options[0].value = "Select Second Category";
document.form.Drop2.options[].text = "";
document.form.Drop2.options[].value = "";
i ++;
}
%>
}
}
function goThere() {
if (document.form.Drop1.selectedIndex == 0) {
alert("Please Select a Product");
} else {
if (document.form.Drop2.selectedIndex == 0) {
alert("Please Select a Model");
} else {
var list1 = document.form.Drop1;
var list2 = document.form.Drop2;
var theDIR = list1.options[list1.selectedIndex].value;
var theProduct = document.form.Drop2.options[list2.selectedIndex].value;
location.href = "http://www.YourLinkHere.com/" + theDIR + "/" + theProduct + ".htm";
}
}
}
Select A Top Category
for (Category top : topCategories) {
%>
}
%>
name="B1">