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

📄 webpagemanage.java

📁 JAVA邮件系统
💻 JAVA
字号:
/**
 * 
 *
 * 管理员管理页面
 * @author Zhu Jian Min
 */

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
 * 
 *WebPageManage.java
 * @author Zhu Jian Min
 * 2000.8。24
 */

//The class hand the Http request
public class WebPageManage extends  HttpServlet{

	public void doPost(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        doGet(request, response);
	}

    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {

       
		HtmlOut htmlOut = new HtmlOut (response);
  

		Person p=new Person();
		PointClass  pointClass =new PointClass();
		p.setName (CommonMethods.GetUserName(request));
		String pass = CommonMethods.GetUserPass (request);
		if( p.getName ()==null || (!p.checkPassword(pass)) )
		{
	    	htmlOut.setErrorID (htmlOut.SHOW_SIMPLE_MESSAGE ,"",
								"请先登录!","Login?action=reLog");
			htmlOut.outHtml();
			return;
		}
		String flag=request.getParameter("flag");
		WebPageManageChannel wpmChannel=new WebPageManageChannel();		
		if (flag==null)  //将页面类型和页面全部显示出来
		{
		//取得页面管理主模板:
		TemplateList tempList=CommonMethods.getWebPageManageTemplate();
		wpmChannel.makeUserManage(p,tempList,htmlOut,null,"");
		}
		else {
			
			if (flag.compareTo("delete")==0) //删除页面
			{
				int nLength=request.getParameterValues("single").length;
				String[] dArray=new String[nLength];
				dArray=request.getParameterValues("single");
				for(int i=0;i<nLength;i++) {
					htmlOut.addString (dArray[i]+"<br>");
					if (pointClass.DeleteWeb  (Integer.valueOf(dArray[i],10).intValue()))
						htmlOut.addString ("ok");					
				}
				
				response.sendRedirect("WebPageManage");
			}
			
			if (flag.compareTo("search")==0) //查询功能
			{
				htmlOut.addString ("查询结果:");
				String type=request.getParameter("type");//得到查询条件
				//if(type!=null)
				type=CommonMethods.DealWithGBCodeOfRequest(type);
				String webpage=request.getParameter("webpage");//得到关键字
				webpage=CommonMethods.DealWithGBCodeOfRequest(webpage);//对关键字做处理
				TemplateList tempList=CommonMethods.getWebPageManageTemplate ();
				wpmChannel.makeUserManage(p,tempList,htmlOut,type,webpage);//用于对页面的一些处理
			}
			
		}
		htmlOut.outHtml();
    }
	
   
}

⌨️ 快捷键说明

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