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

📄 searchcommunityaddress.java

📁 是一个J2EE的项目,在eclipse下编译通过,应用struts,hibernate开源框架,界面不是很漂亮.
💻 JAVA
字号:
package com.bjjd.web;

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 java.util.ArrayList;

import com.bjjd.DAO.CommunityaddressDAO;


/*
 * 
 * 查询社区地址动作
 */

public class Searchcommunityaddress extends Action{
	public ActionForward execute(ActionMapping mapping, ActionForm form,
		    HttpServletRequest request, HttpServletResponse response) throws Exception {
		
	   try
	    {
		   //获取查询参数
	    	String str1=request.getParameter("username1");
	    	String str2=request.getParameter("username2");
	    	String str3=request.getParameter("username3");
	    	//查询结果
	    	CommunityaddressDAO a=new CommunityaddressDAO();
	    	ArrayList users = a.searchcommunityaddress(str1,str2,str3);
	    	//String str2 = String.valueOf(users.size());
	    	//保存结果
	    	HttpSession httpsession=request.getSession();
	    	httpsession.setAttribute("addresslist", users);
	    }
	    catch(Exception e)
	    {
	    	request.setAttribute("error", e.toString());
	    	return (mapping.findForward("failed"));
	    }
		request.setAttribute("rrrr", "success");
	    return (mapping.findForward("success"));
	   
	}

}

⌨️ 快捷键说明

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