📄 setroomjsp_0002ejsp_jsp.java
字号:
import java.sql.*;
import chatroomweb.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class SetRoomJsp_0002ejsp_jsp extends HttpJspBase {
// begin [file="/SetRoomJsp.jsp";from=(4,0);to=(4,68)]
// end
static {
}
public SetRoomJsp_0002ejsp_jsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/SetRoomJsp.jsp";from=(0,48);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(1,31);to=(2,0)]
out.write("\r\n");
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(2,33);to=(4,0)]
out.write("\r\n\r\n");
// end
// begin [file="/SetRoomJsp.jsp";from=(4,0);to=(4,68)]
chatroomweb.DbJspBean dbBean = null;
boolean _jspx_specialdbBean = false;
synchronized (pageContext) {
dbBean= (chatroomweb.DbJspBean)
pageContext.getAttribute("dbBean",PageContext.PAGE_SCOPE);
if ( dbBean == null ) {
_jspx_specialdbBean = true;
try {
dbBean = (chatroomweb.DbJspBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "chatroomweb.DbJspBean");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"chatroomweb.DbJspBean", exc);
}
pageContext.setAttribute("dbBean", dbBean, PageContext.PAGE_SCOPE);
}
}
if(_jspx_specialdbBean == true) {
// end
// begin [file="/SetRoomJsp.jsp";from=(4,0);to=(4,68)]
}
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(4,82);to=(16,0)]
out.write("\r\n\r\n<html>\r\n<head>\r\n<title>\r\nSetRoomJsp\r\n</title>\r\n</head>\r\n<body bgcolor=\"#008080\">\r\n<h1>\r\n房间管理\r\n</h1>\r\n");
// end
// begin [file="/SetRoomJsp.jsp";from=(16,2);to=(39,0)]
int room_count=0;
ResultSet rs;
int i=0;
try
{
dbBean.connect();
String sql="select * from room_info";
rs=dbBean.openRs(sql);
while(rs.next())
{
room_count++;
}
rs.close();
} //检查房间数
catch(Exception e)
{
}
finally
{
}
// 显示
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(39,2);to=(40,29)]
out.write("\r\n <p align=\"center\"><h3>现有房间");
// end
// begin [file="/SetRoomJsp.jsp";from=(40,32);to=(40,42)]
out.print(room_count);
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(40,44);to=(43,44)]
out.write("间</h3></p>\r\n <form method=\"POST\" action=\"do_UpdateRoomJsp.jsp\">\r\n <input type=\"hidden\" name=\"type\" value=\"1\">\r\n <input type=\"hidden\" name=\"count\" value=");
// end
// begin [file="/SetRoomJsp.jsp";from=(43,47);to=(43,75)]
out.print(Integer.toString(room_count));
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(43,77);to=(53,0)]
out.write(">\r\n <div align=\"center\">\r\n <center>\r\n <table border=\"1\" width=\"50%\" cellpadding=\"2\">\r\n <tr>\r\n <td width=\"50%\" align=\"left\"><b><font face=\"\"楷体_GB2312>房间名称</font></b></td>\r\n <td width=\"50%\" align=\"left\"><b><font face=\"\"楷体_GB2312>容纳最大人数</font></b></td>\r\n <td width=\"10%\" align=\"left\"><b><font face=\"\"楷体_GB2312>点选</font></b></td>\r\n </tr>\r\n\r\n");
// end
// begin [file="/SetRoomJsp.jsp";from=(53,2);to=(64,0)]
String roomname;
String roomnum;
String sql="select * from room_info";
rs=dbBean.openRs(sql);
while(rs.next())
{
i++;
roomname=rs.getString("room_name");
roomnum=rs.getString("room_max_member");
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(64,2);to=(66,63)]
out.write("\r\n <tr>\r\n <td width=\"40%\" align=\"left\"><b><font face=\"\"楷体_GB2312>");
// end
// begin [file="/SetRoomJsp.jsp";from=(66,66);to=(66,74)]
out.print(roomname);
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(66,76);to=(67,63)]
out.write("</font></b></td>\r\n <td width=\"40%\" align=\"left\"><b><font face=\"\"楷体_GB2312>");
// end
// begin [file="/SetRoomJsp.jsp";from=(67,66);to=(67,73)]
out.print(roomnum);
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(67,75);to=(68,55)]
out.write("</font></b></td>\r\n <td width=\"20%\"><p> <input type=\"checkbox\" name=");
// end
// begin [file="/SetRoomJsp.jsp";from=(68,58);to=(68,84)]
out.print("room"+Integer.toString(i));
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(68,86);to=(70,0)]
out.write(" value=\"yes\"></p></td>\r\n </tr>\r\n");
// end
// begin [file="/SetRoomJsp.jsp";from=(70,2);to=(72,0)]
}
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(72,2);to=(80,46)]
out.write("\r\n </table>\r\n </center>\r\n </div>\r\n <p align=\"center\"><input type=\"submit\" value=\"删除\" name=\"B1\" > \r\n</form >\r\n <form method = \"POST\"action=\"do_UpdateRoomJsp.jsp\">\r\n <input type=\"hidden\" name = \"type\"value=\"2\">\r\n <input type=\"hidden\" name=\"count\" value=");
// end
// begin [file="/SetRoomJsp.jsp";from=(80,49);to=(80,77)]
out.print(Integer.toString(room_count));
// end
// HTML // begin [file="/SetRoomJsp.jsp";from=(80,79);to=(106,0)]
out.write(">\r\n <table align =\"center\" border=\"1\" width=\"50%\" cellpadding=\"2\">\r\n <tr>\r\n <td width=\"100%\" colspan=\"2\"><font color=\"#00FFFF\">输入房间参数</font></td>\r\n </tr>\r\n <tr>\r\n <td width=\"39%\" align=\"left\"><b><font face=\"楷体_GB2312\">房名</font></b></td>\r\n <td width=\"66%\"><input type=\"text\" name=\"upname\" size=\"20\" > </td>\r\n </tr>\r\n <tr>\r\n <td width=\"39%\" align=\"left\"><b><font face=\"楷体_GB2312\">最大成员数</font></b></td>\r\n <td width=\"66%\"><input type=\"text\" name=\"upmembernum\" size=\"20\" > </td>\r\n </tr>\r\n </table>\r\n <p align=\"center\"><input align=\"center\" type=\"submit\" value=\"增添房间\" name=\"B2\">\r\n</form>\r\n</body>\r\n</html>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -