querychatroomdo.java

来自「一个bbs论坛系统」· Java 代码 · 共 38 行

JAVA
38
字号
package com.lovo.servlet;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

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

import com.lovo.factory.BOFactory;
import com.lovo.po.ChatroomPO;

public class QueryChatroomDO extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		response.setCharacterEncoding("utf-8");
		HttpSession session = request.getSession(true);
		
		List<ChatroomPO> chatList = null;
		try {
			chatList = BOFactory.getChatroomBOInstance().queryAllChatroom();
		} catch (SQLException e) {
			e.printStackTrace();
			response.sendRedirect("error.jsp");
			return;
		}
		session.setAttribute("chatList", chatList);
		response.sendRedirect("../web/admin/chatroomMag.jsp");
	}
}

⌨️ 快捷键说明

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