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

📄 _0002fheader_0002ejspheader_jsp_0.java

📁 Java实例入门
💻 JAVA
字号:
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.Vector;
import org.apache.jasper.runtime.*;
import java.beans.*;
import org.apache.jasper.JasperException;


public class _0002fHeader_0002ejspHeader_jsp_0 extends HttpJspBase {

    // begin [file="D:\\JbuilderProgram\\JspReg\\RegApp\\Common.jsp";from=(0,3);to=(170,0)]
        
        //
        //   Filename: Common.jsp
        //   Generated with CodeCharge  v.1.2.0
        //   JSP.ccp build 05/21/01
        //
        
          static final String CRLF = "\r\n";
        
          static final int UNDEFINT=Integer.MIN_VALUE;
        
          static final int adText = 1;
          static final int adDate = 2;
          static final int adNumber = 3;
          static final int adSearch_ = 4;
          static final int ad_Search_ = 5;
          static final String appPath   ="/";
        
          String toHTML(String value) {
            if ( value == null ) return "";
            value = replace(value, "&", "&");
            value = replace(value, "<", "&lt;");
            value = replace(value, ">", "&gt;");
            value = replace(value, "\"", "&" + "quot;");
            return value;
          }
        private String replace(String str, String pattern, String replace) {
            if (replace == null) {
              replace = "";
            }
            int s = 0, e = 0;
            StringBuffer result = new StringBuffer((int) str.length()*2);
            while ((e = str.indexOf(pattern, s)) >= 0) {
              result.append(str.substring(s, e));
              result.append(replace);
              s = e + pattern.length();
            }
            result.append(str.substring(s));
            return result.toString();
          }
        
          boolean isNumber (String param) {
            boolean result;
            if ( param == null || param.equals("")) return true;
            param=param.replace('d','_').replace('f','_');
            try {
              Double dbl = new Double(param);
              result = true;
            }
            catch (NumberFormatException nfe) {
              result = false;
            }
            return result;
          }
        
          boolean isEmpty (int val){
            return val==UNDEFINT;
          }
        
          boolean isEmpty (String val){
            return (val==null || val.equals("")||val.equals(Integer.toString(UNDEFINT)));
          }
        
        
        
          String toWhereSQL(String fieldName, String fieldVal, int type) {
            String res = "";
            switch(type) {
              case adText:
                if (! "".equals(fieldVal)) {
                  res = " " + fieldName + " like '%" + fieldVal + "%'";
                }
              case adNumber:
                res = " " + fieldName + " = " + fieldVal + " ";
              case adDate:
                res = " " + fieldName + " = '" + fieldVal + "' ";
              default:
                res = " " + fieldName + " = '" + fieldVal + "' ";
            }
            return res;
          }
        
          String toSQL(String value, int type) {
            if ( value == null ) return "Null";
            String param = value;
            if ("".equals(param) && (type == adText || type == adDate) ) {
              return "Null";
            }
            switch (type) {
              case adText: {
                param = replace(param, "'", "''");
                param = replace(param, "&amp;", "&");
                param = "'" + param + "'";
                break;
              }
              case adSearch_:
              case ad_Search_: {
                param = replace(param, "'", "''");
                break;
              }
              case adNumber: {
                try {
                  if (! isNumber(value) || "".equals(param)) param="null";
                  else param = value;
                }
                catch (NumberFormatException nfe) {
                  param = "null";
                }
                break;
              }
              case adDate: {
                param = "'" + param + "'";
                break;
              }
            }
            return param;
          }
        
        
          String getOptions( java.sql.ResultSet rs,boolean isSearch, boolean isRequired, String selectedValue ) {
        
            String sOptions = "";
            String sSel = "";
        
            if ( isSearch ) {
             sOptions += "<option value=\"\">All</option>";
            }
            else {
              if ( ! isRequired ) {
               sOptions += "<option value=\"\"></option>";
              }
            }
            try {
              while (rs.next() ) {
                String id = toHTML( rs.getString(1) );
                String val =  rs.getString(2);
                val=toHTML(val);
                if ( id.compareTo(selectedValue) == 0 ) {
                  sSel = "SELECTED";
                }
                else  {
                  sSel = "";
                }
                sOptions += "<option value=\""+id+"\" "+sSel+">"+val+"</option>";
        
        
        
              }
              rs.close();
            }
            catch (Exception e) {}
            return sOptions;
          }
        
        String getParam(javax.servlet.http.HttpServletRequest req, String paramName) {
            String param = req.getParameter(paramName);
            if ( param == null || param.equals("") ) return "";
            param = replace(param,"&amp;","&");
            param = replace(param,"&lt;","<");
            param = replace(param,"&gt;",">");
            param = replace(param,"&amp;lt;","<");
            param = replace(param,"&amp;gt;",">");
            return param;
          }
        
        
        
        
        
        
    // end

    static {
    }
    public _0002fHeader_0002ejspHeader_jsp_0( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws JasperException {
    }

    public void _jspService(HttpServletRequest request, HttpServletResponse  response)
        throws 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) {
                _jspx_init();
                _jspx_inited = true;
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html;charset=gb2312");
            pageContext = _jspxFactory.getPageContext(this, request, response,			"", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin [file="D:\\JbuilderProgram\\JspReg\\RegApp\\Header.jsp";from=(0,32);to=(1,0)]
                out.write("\r\n");            // end
            // HTML // begin [file="D:\\JbuilderProgram\\JspReg\\RegApp\\Header.jsp";from=(1,50);to=(17,0)]
                out.write("\r\n<center>\r\n <table width=\"80%\">\r\n  <tr>\r\n   <td align=middle valign=\"top\">\r\n     <table border=\"0\" cellspacing=\"2\" cellpadding=\"1\" bordercolor=\"#BCBC7A\" bordercolorlight=\"#000000\" bordercolordark=\"#FFFFFF\" >\r\n         <tr>\r\n            <td align=middle bgcolor=\"#DDDDBD\"><a href=\"Default.jsp\"><font style=\"font-size: 10pt; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica\">首页</font></a></td>\r\n            <td align=middle bgcolor=\"#DDDDBD\"><a href=\"Registration.jsp\"><font style=\"font-size: 10pt; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica\">注册</font></a></td>\r\n            <td align=middle bgcolor=\"#DDDDBD\"><a href=\"MyDetails.jsp\"><font style=\"font-size: 10pt; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica\">我的详细资料</font></a></td>\r\n         </tr>\r\n    </table>\r\n   </td>\r\n  </tr>\r\n </table>\r\n\r\n");            // end

        } catch (Exception ex) {
            if (out.getBufferSize() != 0)
                out.clearBuffer();
            pageContext.handlePageException(ex);
        } finally {
            out.flush();
            _jspxFactory.releasePageContext(pageContext);
        }
    }
}

⌨️ 快捷键说明

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