編輯:關於android開發
1.創建表
CREATE TABLE `categorysecond` ( `csid` int(11) NOT NULL AUTO_INCREMENT, `csname` varchar(255) DEFAULT NULL, `cid` int(11) DEFAULT NULL, PRIMARY KEY (`csid`), KEY `FK936FCAF21DB1FD15` (`cid`), CONSTRAINT `FK936FCAF21DB1FD15` FOREIGN KEY (`cid`) REFERENCES `category` (`cid`) ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; INSERT INTO `categorysecond` VALUES ('1', '潮流女裝', '1'); INSERT INTO `categorysecond` VALUES ('2', '初冬羽絨', '1'); INSERT INTO `categorysecond` VALUES ('3', '毛呢大衣', '1'); INSERT INTO `categorysecond` VALUES ('4', '溫暖毛衣', '1'); INSERT INTO `categorysecond` VALUES ('5', '精選男裝', '1'); INSERT INTO `categorysecond` VALUES ('6', '冬季外套', '1'); INSERT INTO `categorysecond` VALUES ('7', '羽絨服', '1'); INSERT INTO `categorysecond` VALUES ('9', '女鞋', '2'); INSERT INTO `categorysecond` VALUES ('10', '短靴', '2'); INSERT INTO `categorysecond` VALUES ('11', '男鞋', '2'); INSERT INTO `categorysecond` VALUES ('12', '女包', '2'); INSERT INTO `categorysecond` VALUES ('13', '男包', '2'); INSERT INTO `categorysecond` VALUES ('14', '服飾配件', '2'); INSERT INTO `categorysecond` VALUES ('15', '運動鞋', '3'); INSERT INTO `categorysecond` VALUES ('16', '運動服', '3'); INSERT INTO `categorysecond` VALUES ('17', '戶外運動', '3'); INSERT INTO `categorysecond` VALUES ('18', '健身裝備', '3'); INSERT INTO `categorysecond` VALUES ('19', '騎行裝備', '3'); INSERT INTO `categorysecond` VALUES ('20', '珠寶首飾', '4'); INSERT INTO `categorysecond` VALUES ('21', '時尚飾品', '4'); INSERT INTO `categorysecond` VALUES ('22', '品質手表', '4'); INSERT INTO `categorysecond` VALUES ('23', '眼鏡配飾', '4'); INSERT INTO `categorysecond` VALUES ('24', '手機', '5'); INSERT INTO `categorysecond` VALUES ('25', '平板', '5'); INSERT INTO `categorysecond` VALUES ('26', '電腦', '5'); INSERT INTO `categorysecond` VALUES ('27', '相機', '5'); INSERT INTO `categorysecond` VALUES ('28', '大家電', '6'); INSERT INTO `categorysecond` VALUES ('29', '廚房電器', '6'); INSERT INTO `categorysecond` VALUES ('30', '生活電器', '6'); INSERT INTO `categorysecond` VALUES ('31', '個戶電器', '6'); INSERT INTO `categorysecond` VALUES ('32', '辦公耗材', '6'); INSERT INTO `categorysecond` VALUES ('33', '美容護膚', '7'); INSERT INTO `categorysecond` VALUES ('34', '強效保養', '7'); INSERT INTO `categorysecond` VALUES ('35', '超值彩妝', '7'); INSERT INTO `categorysecond` VALUES ('36', '換季保養', '7');
2.一級分類下二級分類
<s:iterator var="c" value="#session.cList"> <dl> <dt> <a href="${pageContext.request.contextPath}/product_findByCid.action?cid=<s:property value="#c.cid"/>&page=1"><s:property value="#c.cname"/></a> </dt> <s:iterator var="cs" value="#c.categorySeconds"> <dd> <a href="${ pageContext.request.contextPath }/product_findByCsid.action?csid=<s:property value="#cs.csid"/>&page=1"><s:property value="#cs.csname"/></a> </dd> </s:iterator> </dl> </s:iterator>
Category.hbm.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="cn.itcast.shop.category.vo.Category" table="category"> <id name="cid" column="cid"> <generator class="native"></generator> </id> <property name="cname" column="cname"/> <set name="categorySeconds" order-by="csid" fetch="join" lazy="false" cascade="delete"> <key column="cid"/> <one-to-many class="cn.itcast.shop.categorysecond.vo.CategorySecond"/> </set> </class> </hibernate-mapping>
Android中View的滑動沖突——Android開發藝術探索筆記 介紹 相信開發Android的人都會有這種體會:從網上下載的demo運行的好好的,但是只要出現了
Centos 7 安裝VNC步驟VNC允許Linux系統可以類似實現像Windows中的遠程桌面訪問那樣訪問Linux桌面。本文配置機器是興寧市網絡信息中心的一台Cent
Android用戶界面的組成除了View外,還包括菜單和對話框,本節我們先來學
setting菜單界面的形成--未優化,setting菜單界面-- 代碼: first_preference.xml: 1 <?xml versi