⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 storeproductsaction.java

📁 jsp网页
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.rfid.struts.action;

import java.util.Date;
import java.util.List;

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

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessages;

import com.rfid.dao.TOrderDAO;
import com.rfid.dao.TStoreProductsDAO;
import com.rfid.global.CharFilter;
import com.rfid.global.Global;
import com.rfid.model.TOrder;
import com.rfid.model.TUSer;
import com.rfid.struts.form.StoreProductsForm;

/** 
 * MyEclipse Struts
 * Creation date: 10-31-2006
 * 
 * XDoclet definition:
 * @struts.action path="/storeProducts" name="storeProductsForm" input="/form/storeProducts.jsp" scope="request" validate="true"
 */
public class StoreProductsAction extends Action {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		StoreProductsForm storeProductsForm = (StoreProductsForm) form;// TODO Auto-generated method stub
		
		ActionForward forward = new ActionForward();
        ActionMessages msgs = new ActionMessages();
        
        /* 获得用户信息 */
        HttpSession session = request.getSession();
    	TUSer user = (TUSer)session.getAttribute(Global.USER);
    	if(user == null)
    	{
    		request.setAttribute("error", "非法输入");
			forward = new  ActionForward("","/pages/error.jsp",true);
			return forward;
    	}
        
        if(storeProductsForm == null){
			request.setAttribute("error", "非法输入");
			forward = new  ActionForward("","/pages/error.jsp",true);
			return forward;
		}
        
        String todo = storeProductsForm.getTodo();
		if(todo == null ){
			request.setAttribute("error", "非法输入");
			forward = new  ActionForward("","/pages/error.jsp",true);
			return forward;
		} else if(todo.equals("search")){
			String name = "";
			if(storeProductsForm.getName() != null){
				name = storeProductsForm.getName();
			}
			
			name = CharFilter.convertISO2Utf(name);
			
			TStoreProductsDAO storeProductDAO = new TStoreProductsDAO();
			List productList = storeProductDAO.searchByName(name);
			
			session.setAttribute("productList", productList);
			forward = new  ActionForward("","/pages/warehouse/warehouse_search.jsp",true);
			return forward;
		}
		
		request.setAttribute("error", "非法输入");
		forward = new  ActionForward("","/pages/error.jsp",true);
        saveMessages(request, msgs);
        return forward;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -