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

📄 leftbar_0002ejsp_jsp.java

📁 网上书店,JSP,MYSQL,struct,spring,hibernate
💻 JAVA
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class LeftBar_0002ejsp_jsp extends HttpJspBase {


    static {
    }
    public LeftBar_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="/LeftBar.jsp";from=(0,48);to=(1,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/LeftBar.jsp";from=(1,30);to=(42,0)]
                out.write("\r\n<html>\r\n<body>\r\n<script language=\"JavaScript\"></script>\r\n<!--<img src=\"images\\\\hunt2.gif\">-->\r\n<table align=\"center\" width=\"40%\" align=\"center\">\r\n<form action=\"Inquire.jsp\" method=\"post\" >\r\n<tr align=\"center\">\r\n<td colspan=\"2\">\r\n<input align=\"center\" name=\"bookname\" maxlength=\"50\" size=12>\r\n</td>\r\n</tr>\r\n<tr align=\"center\">\r\n<td>\r\n<select name=\"inquireType\">\r\n\t\t<option value=\"0\" selected>书名</option>\r\n\t\t<option value=\"1\">作者</option>\r\n\t\t<option value=\"2\">出版社</option>\r\n</select>\r\n<input align=\"center\" type=\"submit\" value=\"查 询\" onclick=\"if(bookname.value=='') {alert('请输入查询关键字');return false;}return true;\"></td>\r\n</tr>\r\n</form>\r\n</table>\r\n<table align=\"center\" style=\"background:url(images\\\\bg1.gif\">\r\n<tr>\r\n<td>\r\n<form method=\"post\" action=\"LoginYanzh.jsp\">\r\n<tr><td>用户名:</td><td><input name=\"username\" type=\"text\" size=\"12\" maxlength=\"30\"></td></tr>\r\n<tr><td >密&nbsp;&nbsp;码:</td><td><input name=\"password\" type=\"password\" size=\"12\" maxlength=\"20\"></td></tr>\r\n<tr><td height=\"10\"></td></tr>\r\n<tr>\r\n<td align=\"center\"><input name=\"submit\" type=\"image\" src=\"images\\\\enter.gif\" ></td></form>\r\n<td><form action=\"Register.jsp\" method=\"post\" ><input name=\"submit\" type=\"image\" src=\"images\\\\register.gif\"></tr></td></form></td>\r\n</tr>\r\n<!--<tr><td colspan=\"2\" align=\"center\"><form action=\"LogOut.jsp\"><input name=\"submit\" type=\"submit\" value=\"注销\"></form></td></tr>-->\r\n</table>\r\n<br><br>\r\n<table align=\"center\">\r\n<tr>\r\n<td align=\"center\">书籍种类</td>\r\n</tr>\r\n");

            // end
            // begin [file="/LeftBar.jsp";from=(42,2);to=(54,0)]
                
                //String type[]=null;
                String sql="select type from book_type"; //
                //int count=0;
                try{
                	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
                	Connection con=DriverManager.getConnection("jdbc:odbc:Shopping");
                	Statement st=con.createStatement();
                	ResultSet rs=st.executeQuery(sql) ;
                	while(rs.next()){
                        	String type=rs.getString("type");
                		//session.setAttribute("t_type",type) ;
            // end
            // HTML // begin [file="/LeftBar.jsp";from=(54,2);to=(55,51)]
                out.write("\r\n<tr><td align=\"center\"><a href=\"TypeCheck.jsp?type=");

            // end
            // begin [file="/LeftBar.jsp";from=(55,54);to=(55,58)]
                out.print(type);
            // end
            // HTML // begin [file="/LeftBar.jsp";from=(55,60);to=(55,62)]
                out.write("\">");

            // end
            // begin [file="/LeftBar.jsp";from=(55,65);to=(55,70)]
                out.print(type );
            // end
            // HTML // begin [file="/LeftBar.jsp";from=(55,72);to=(56,0)]
                out.write("</a></td></td>\r\n");

            // end
            // begin [file="/LeftBar.jsp";from=(56,2);to=(61,0)]
                
                //System.out.println(session.getAttribute("t_type") );}
                    }
                }
                catch(Exception e){System.out.println(e.getMessage() ) ;}
            // end
            // HTML // begin [file="/LeftBar.jsp";from=(61,2);to=(65,0)]
                out.write("\r\n</table>\r\n</body>\r\n</html>\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 + -