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

📄 administratorshowclientaction.java

📁 电子商务网站使用MVC模式B/S结构功能不是很全适合初学者看
💻 JAVA
字号:
package Administrator;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.util.ArrayList;
import Common.DBConnectBean;
public class administratorShowClientAction extends HttpServlet{
	public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException{
		ServletContext application=getServletConfig().getServletContext(); 
		DBConnectBean dbConnectBean=new DBConnectBean("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:shopping","","");
		request.setCharacterEncoding("gb2312");
		HttpSession session=request.getSession();
		String username=request.getParameter("username");
/*-------------先解决人气排行*/
		Hashtable table=dbConnectBean.getOneRecord("select * from client where username='"+username+"'");
		String sex="",identifyCard="",qq="",email="",phone="",address="",describe="";
		//System.out.println("list有这么大"+list.size());
		if(table!=null){	
			sex=table.get("sex".toUpperCase()).toString();
			identifyCard=table.get("identifyCard".toUpperCase()).toString();
			qq=table.get("qq".toUpperCase()).toString();
			email=table.get("email".toUpperCase()).toString();
			phone=table.get("phone".toUpperCase()).toString();
			address=table.get("address".toUpperCase()).toString();
			describe=table.get("describe".toUpperCase()).toString();
			
			table.put("username".toUpperCase(),username);
			table.put("sex".toUpperCase(),sex);
			table.put("identifyCard".toUpperCase(),identifyCard);
			table.put("qq".toUpperCase(),qq);
			table.put("email".toUpperCase(),email);
			table.put("phone".toUpperCase(),phone);
			table.put("address".toUpperCase(),address);
			table.put("describe".toUpperCase(),describe);
			//System.out.println("str是"+str);
			//System.out.println("id是"+id);
		
		}
		//System.out.println("temp有这么大"+temp.size());
		//这个是所有用户共同拥有的,所以用application来保存
		session.setAttribute("clientInf".toUpperCase(),table);
		application.getRequestDispatcher("/administrator/administratorShowClientInf.jsp").forward(request,response);
	}
	public void doPost(HttpServletRequest request,HttpServletResponse response)
	   throws IOException,ServletException
	   {
	   	doGet(request,response);
	   }
}

⌨️ 快捷键说明

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