亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cellphoneeditaction.java

?? 這個是完整的wap項目的源碼 開發(fā)語言 Java 系統(tǒng)架構(gòu) Struts + hibernate + spring 數(shù)據(jù)庫 Mysql5.0 應(yīng)用服務(wù)器Tomcat5.0 開發(fā)工具 MyEc
?? JAVA
字號:
package com.longtime.wap.module.cellphone.web.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.DispatchActionSupport;

import com.longtime.wap.common.WapConstant;
import com.longtime.wap.model.Cellphone;
import com.longtime.wap.module.cellphone.service.CellphoneService;
import com.longtime.wap.module.cellphone.web.form.CellphoneForm;

/**
 * 處理修改請求
 * 
 * @author shiz
 * @date Nov 19, 2007
 */
public class CellphoneEditAction extends DispatchActionSupport {
	private static final Log LOGGER = 
		LogFactory.getLog(CellphoneEditAction.class);
	private CellphoneService cellphoneService;

	/**
	 * 注入服務(wù)對象
	 * 
	 * @param cellphoneService
	 *            設(shè)置服務(wù)對象
	 */
	public void setCellphoneService(CellphoneService cellphoneService) {
		this.cellphoneService = cellphoneService;
	}

	/**
	 * 獲得相應(yīng)手機(jī)信息
	 * 
	 * @param mapping
	 *            ActionMapping對象
	 * @param form
	 *            ActionForm對象
	 * @param request
	 *            HttpServletRequest對象
	 * @param response
	 *            HttpServletResponse對象
	 * @return ActionForward對象
	 * @throws Exception
	 *             異常處理
	 */
	public ActionForward getCellphone(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		Cellphone cellphone = null;
		String type = request.getParameter("type");
		// 設(shè)置返回的formbean對象
		CellphoneForm cellphoneForm = (CellphoneForm) form;
		String cellphoneId = request.getParameter("id");
		try {
			// 根據(jù)Id取information
			if (null != cellphoneId) {
				cellphone = cellphoneService.getCellphoneById(Long
						.parseLong(cellphoneId));
				cellphoneForm.setCellphoneId(String.valueOf(cellphone
						.getCellphoneId()));
				cellphoneForm.setCellphoneUA(String.valueOf(cellphone.getUa()));
				cellphoneForm.setCellphoneType(String.valueOf(cellphone
						.getModel()));
				cellphoneForm.setCellphoneCompany(String.valueOf(cellphone
						.getBrand()));
				cellphoneForm.setUniqueUa(String.valueOf(cellphone.getUa()));
				cellphoneForm.setUniqueType(String
						.valueOf(cellphone.getModel()));
				if ("view".equalsIgnoreCase(type)) {
					String imageType = "";
					if (cellphone.getSupportImageType() == 0) {
						imageType = "Png";
					} else if (cellphone.getSupportImageType() == 1) {
						imageType = "Jpg";
					} else if (cellphone.getSupportImageType() == 2) {
						imageType = "Bmp";
					} else {
						imageType = "Gif";
					}
					cellphoneForm.setCellphonePicture(imageType);
				} else {
					cellphoneForm.setCellphonePicture(String.valueOf(cellphone
							.getSupportImageType()));
				}
				request.setAttribute("cellphoneForm", cellphoneForm);
			}
			// 設(shè)置返回頁面是否允許編輯
			if ("edit".equalsIgnoreCase(type)) {
				cellphoneForm.setEditFlug("edit");
			}
			if ("view".equalsIgnoreCase(type)) {
				cellphoneForm.setEditFlug("view");
			}
			if ("new".equalsIgnoreCase(type)) {
				cellphoneForm.setEditFlug("new");
			}

		} catch (Exception ex) {
			LOGGER.error(ex);
			ex.printStackTrace();
		}
		return mapping.findForward("detailCellphone");
	}

	/**
	 * 處理新增或修改中的保存請求
	 * 
	 * @param mapping
	 *            ActionMapping對象
	 * @param form
	 *            ActionForm對象
	 * @param request
	 *            HttpServletRequest對象
	 * @param response
	 *            HttpServletResponse對象
	 * @return ActionForward對象
	 * @throws Exception
	 *             異常對象
	 */
	public ActionForward saveCellphone(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		List<String> messages = new ArrayList<String>();
		try {
			CellphoneForm cellphoneForm = (CellphoneForm) form;
			String flug = cellphoneForm.getEditFlug();
			String ua = cellphoneForm.getCellphoneUA().trim();
			String model = cellphoneForm.getCellphoneType().trim();
			Cellphone cellphone;
			if (flug.equals("new")) {
				// 增加
				cellphone = new Cellphone();
				if (null == cellphoneService.getCellphoneByUA(ua)) {
					if (null == cellphoneService.getCellphoneByModel(model)) {
						cellphone.setUa(cellphoneForm.getCellphoneUA().trim());
						cellphone.setModel(cellphoneForm.getCellphoneType()
								.trim());
						cellphone.setBrand(cellphoneForm.getCellphoneCompany()
								.trim());
						cellphone.setSupportImageType(Long
								.parseLong(cellphoneForm.getCellphonePicture()
										.trim()));
						cellphoneService.saveCellphone(cellphone);
						messages.add("手機(jī)信息保存成功!");
					} else {
						messages.add("手機(jī)型號已經(jīng)存在!");
						request.setAttribute(WapConstant.WAP_GLOBAL_MESSAGES,
								messages);
						return mapping.findForward("failed");
					}
				} else {
					messages.add("手機(jī)UA已經(jīng)存在!");
					request.setAttribute(WapConstant.WAP_GLOBAL_MESSAGES,
							messages);
					return mapping.findForward("failed");
				}
			} else if (flug.equals("edit")) {
				// 修改
				cellphone = cellphoneService.getCellphoneById(Long
						.parseLong(cellphoneForm.getCellphoneId()));
				if (null != cellphoneForm.getCellphoneId()
						&& cellphoneForm.getCellphoneId().length() > 0) {
					if (cellphoneForm.getUniqueUa().equals(ua)
							|| (null == cellphoneService.getCellphoneByUA(ua))) 
					{
						cellphone.setUa(cellphoneForm.getCellphoneUA().trim());
					} else {
						messages.add("手機(jī)UA已經(jīng)存在!");
						request.setAttribute(WapConstant.WAP_GLOBAL_MESSAGES,
								messages);
						return mapping.findForward("failed");
					}
					if (cellphoneForm.getUniqueType().equals(model)
							|| (null == cellphoneService
									.getCellphoneByModel(model))) {
						cellphone.setModel(cellphoneForm.getCellphoneType()
								.trim());
					} else {
						messages.add("手機(jī)型號已經(jīng)存在!");
						request.setAttribute(WapConstant.WAP_GLOBAL_MESSAGES,
								messages);
						return mapping.findForward("failed");
					}
					cellphone.setBrand(cellphoneForm.getCellphoneCompany()
							.trim());
					cellphone.setSupportImageType(Long.parseLong(cellphoneForm
							.getCellphonePicture().trim()));
					cellphoneService.saveCellphone(cellphone);
					messages.add("手機(jī)信息修改成功!");
				} else {
					messages.add("沒有此手機(jī)信息");
				}
			}
		} catch (Exception ex) {
			LOGGER.error(ex);
			messages.add("手機(jī)信息保存失敗");
			ex.printStackTrace();
		}
		request.setAttribute(WapConstant.WAP_GLOBAL_MESSAGES, messages);
		return mapping.findForward("cellphones");

	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久尤物电影视频在线观看| 亚洲乱码精品一二三四区日韩在线| 亚洲最新视频在线播放| 99国产精品99久久久久久| 国产人伦精品一区二区| 99视频超级精品| 亚洲猫色日本管| 欧美日韩综合一区| 丝袜亚洲精品中文字幕一区| 欧美一级日韩一级| 国产成人精品影视| 日韩毛片在线免费观看| 欧美日韩中文字幕精品| 久久99精品国产91久久来源| 亚洲国产高清aⅴ视频| 在线视频你懂得一区二区三区| 水野朝阳av一区二区三区| 欧美变态tickle挠乳网站| 精品亚洲porn| 一区二区三区在线视频观看58| 8x福利精品第一导航| 国产精品一区二区久久不卡| 久久九九99视频| 91黄色免费版| 国产一区二区免费看| 一区二区久久久久| 精品国产不卡一区二区三区| 色诱视频网站一区| 精品亚洲成a人| 亚洲丝袜精品丝袜在线| 欧美日韩在线播放三区四区| 狠狠狠色丁香婷婷综合激情| 亚洲精品免费一二三区| 欧美色电影在线| 国产传媒久久文化传媒| 国产精品二三区| 欧美丰满高潮xxxx喷水动漫| 成人av高清在线| 日韩1区2区3区| 国产精品国产a级| 8x福利精品第一导航| av一二三不卡影片| 久久99最新地址| 亚洲国产人成综合网站| 国产婷婷色一区二区三区| 欧美日韩在线一区二区| 成人福利视频网站| 免费观看成人av| 一区二区激情视频| 国产精品久久久久久久第一福利| 这里只有精品99re| 欧美最猛性xxxxx直播| 盗摄精品av一区二区三区| 视频一区视频二区在线观看| 亚洲精品国久久99热| 国产午夜亚洲精品理论片色戒| 欧美精品一二三区| 色婷婷激情综合| 国产一区二区三区在线看麻豆| 天堂成人国产精品一区| 一区二区三区在线免费观看| 欧美激情一区二区三区全黄| 91精品久久久久久蜜臀| 欧洲精品中文字幕| 成人av中文字幕| 国产成人av一区二区三区在线观看| 日韩av电影天堂| 日韩av电影天堂| 午夜影院久久久| 亚洲一区二区四区蜜桃| 亚洲欧洲www| 中文字幕亚洲欧美在线不卡| 国产免费观看久久| 久久久九九九九| 久久久久99精品国产片| 久久影院午夜片一区| 精品国产第一区二区三区观看体验| 欧美一级黄色录像| 91精品国产91久久久久久最新毛片 | 国产乱码精品1区2区3区| 亚洲精品高清视频在线观看| 国产精品乱人伦| 久久综合色8888| 国产亚洲一区二区三区在线观看| 精品乱码亚洲一区二区不卡| 精品国产123| 久久人人爽爽爽人久久久| 久久一区二区视频| 国产亚洲精品aa午夜观看| 国产亚洲欧洲一区高清在线观看| 久久久欧美精品sm网站| 国产精品三级电影| 亚洲色图另类专区| 亚洲精品一二三四区| 亚洲欧美偷拍三级| 午夜亚洲国产au精品一区二区| 一级做a爱片久久| 天天色综合天天| 另类综合日韩欧美亚洲| 国产a区久久久| 色综合网色综合| 欧美喷潮久久久xxxxx| 欧美一区二区三区四区久久| 久久综合网色—综合色88| 欧美激情综合在线| 亚洲精选视频在线| 天天色天天操综合| 国产一区二区三区在线看麻豆| 成人av先锋影音| 欧美午夜在线观看| 欧美精品一区二区三区久久久| 国产精品美日韩| 午夜精品123| 激情综合色播五月| 91在线观看美女| 91精品国产综合久久蜜臀| 久久亚洲私人国产精品va媚药| 中文字幕在线视频一区| 视频在线观看91| 成人a级免费电影| 欧美日本国产一区| 欧美国产精品中文字幕| 亚洲国产cao| 丰满少妇在线播放bd日韩电影| 色婷婷狠狠综合| 欧美一区二区三区思思人| 国产精品久久一卡二卡| 婷婷国产v国产偷v亚洲高清| 成人免费毛片片v| 欧美一个色资源| 一区二区在线看| 国产酒店精品激情| 欧美亚洲一区二区三区四区| 精品久久久久久最新网址| 怡红院av一区二区三区| 国产91精品一区二区麻豆网站| 欧美另类高清zo欧美| 国产女人18水真多18精品一级做| 蜜臀精品一区二区三区在线观看 | 有码一区二区三区| 精品一区二区免费| 欧美日韩一级二级| 日韩一区日韩二区| 精品系列免费在线观看| 在线观看91av| 一区二区在线免费观看| 成人av综合在线| 久久久精品综合| 蜜桃视频第一区免费观看| 色婷婷av久久久久久久| 国产精品久久久久久久久晋中| 黑人精品欧美一区二区蜜桃| 欧美一区欧美二区| 亚洲成人一区二区在线观看| voyeur盗摄精品| 国产精品网站在线观看| 国产一区二区三区电影在线观看 | 久久久一区二区三区捆绑**| 日韩成人免费电影| 欧美性受xxxx黑人xyx性爽| 亚洲女同ⅹxx女同tv| 成人国产视频在线观看| 国产日韩三级在线| 成人做爰69片免费看网站| 久久只精品国产| 精品亚洲国产成人av制服丝袜| 日韩欧美在线影院| 欧美bbbbb| 精品黑人一区二区三区久久 | 亚洲a一区二区| 欧美在线|欧美| 亚洲精品五月天| 91福利精品视频| 亚洲一二三四久久| 欧美年轻男男videosbes| 亚洲国产精品久久人人爱| 欧美在线一二三四区| 亚洲国产一区二区三区| 欧美色图免费看| 日本欧美在线观看| 日韩欧美www| 韩国精品主播一区二区在线观看 | 中文字幕一区二区三区蜜月 | 国产精品热久久久久夜色精品三区 | 一区二区三区在线视频观看 | 日本一区二区高清| eeuss鲁片一区二区三区在线观看| 亚洲国产高清不卡| 日本韩国精品在线| 日韩精品一级二级| 久久综合一区二区| 激情综合色播五月| 国产清纯美女被跳蛋高潮一区二区久久w| 国产一区二区三区在线观看精品| 久久综合九色综合欧美就去吻| 国产成人综合在线观看| 亚洲精品午夜久久久| 91麻豆精品国产91久久久使用方法 | 国产精品区一区二区三区| 97se狠狠狠综合亚洲狠狠|