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

📄 doxml.java

📁 JSP的http通讯,通过JS控制直接可以前后台交互。
💻 JAVA
字号:
/*
 * Created on 2007-10-29
 *
 * Copyright:Hangzhou SINCERE TECHNOLOGY Co.,LTD
 */
package sbgl.servlet;

import java.io.IOException;
import java.io.PrintWriter;

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

import sbgl.LoginInfo;
import sbgl.MyFunction;
import sbgl.SessionProcess;
import sbgl.UserFunc;
import sbgl.action.LoginAction;
import sbgl.dao.GBookDAO;
import sbgl.dao.PublicDAO;
import sbgl.dao.SBLyDAO;

/**
 * @author SnowBabyChina
 *
 * Copyright:Hangzhou SINCERE TECHNOLOGY Co.,LTD
 */
public class doXml extends HttpServlet {

    /**
     * Destruction of the servlet. <br>
     */
    public void destroy() {
        super.destroy(); // Just puts "destroy" string in log
        // Put your code here
    }

    /**
     * The doGet method of the servlet. <br>
     *
     * This method is called when a form has its tag value method equals to get.
     * 
     * @param request the request send by the client to the server
     * @param response the response send by the server to the client
     * @throws ServletException if an error occurred
     * @throws IOException if an error occurred
     */
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = response.getWriter();
        
        boolean m_bRet=false;
        UserFunc uf = new UserFunc();
        MyFunction mf = new MyFunction();
        
        String m_strResultHtml="";
        String m_strClientNo = uf.result(request.getParameter("ClientNo"));
        String m_strOpFlag = uf.result(request.getParameter("opflag"));

        LoginInfo loginInfo = new LoginInfo();
        SessionProcess sessionProcess = new SessionProcess();
        loginInfo = sessionProcess.getLoginInfo(m_strClientNo);        
        if(loginInfo!=null){
            if(m_strOpFlag.equals("show_OnlineUser")){
                LoginAction logAct = new LoginAction();
                m_strResultHtml = logAct.getOnlineUserInfo();
                
            }else if(m_strOpFlag.equals("show_GuestBook")){
                GBookDAO gbDAO = new GBookDAO();
                m_strResultHtml=gbDAO.getGBTopHtml(loginInfo.lg_belong);
                
            }else if(m_strOpFlag.equals("show_Sbgl_Info")){
                SBLyDAO lyDAO = new SBLyDAO();
                m_strResultHtml = lyDAO.getSBGLClassTopHtml(loginInfo);
                
            }else if(m_strOpFlag.equals("show_publish")){
                PublicDAO pubDAO = new PublicDAO();
                m_strResultHtml = pubDAO.getPublish(loginInfo);
                
            }	
            if(!m_strResultHtml.equals(""))
                m_bRet = true;
        }
        if(!m_bRet){	//由于您长时间未操作本功能,系统已自动关闭本功能,请重新登录后再操作!
            out.print("<div align=center>&#x7531;&#x4E8E;&#x60A8;&#x957F;&#x65F6;&#x95F4;&#x672A;&#x64CD;&#x4F5C;&#x672C;&#x529F;&#x80FD;&#xFF0C;&#x7CFB;&#x7EDF;&#x5DF2;&#x81EA;&#x52A8;&#x5173;&#x95ED;&#x672C;&#x529F;&#x80FD;&#xFF0C;&#x8BF7;&#x91CD;&#x65B0;&#x767B;&#x5F55;&#x540E;&#x518D;&#x64CD;&#x4F5C;&#xFF01;</div>");
        }else{
            out.print(m_strResultHtml);
        }
        out.flush();
        out.close();
    }

    /**
     * The doPost method of the servlet. <br>
     *
     * This method is called when a form has its tag value method equals to post.
     * 
     * @param request the request send by the client to the server
     * @param response the response send by the server to the client
     * @throws ServletException if an error occurred
     * @throws IOException if an error occurred
     */
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        this.doGet(request, response);
    }

    /**
     * Initialization of the servlet. <br>
     *
     * @throws ServletException if an error occure
     */
    public void init() throws ServletException {
        // Put your code here
    }

}

⌨️ 快捷键说明

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