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

📄 _0002fmydetails_0002ejspmydetails_jsp_0.java

📁 Java实例入门
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
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 _0002fMyDetails_0002ejspMyDetails_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
    // begin [file="D:\\JbuilderProgram\\JspReg\\RegApp\\MyDetails.jsp";from=(1,53);to=(2,0)]
        
    // end
    // begin [file="D:\\JbuilderProgram\\JspReg\\RegApp\\MyDetails.jsp";from=(36,0);to=(36,64)]
    // end

    static {
    }
    public _0002fMyDetails_0002ejspMyDetails_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\\MyDetails.jsp";from=(0,32);to=(1,0)]
                out.write("\r\n");            // end
            // begin [file="D:\\JbuilderProgram\\JspReg\\RegApp\\MyDetails.jsp";from=(2,4);to=(25,0)]
                
                   String currentUser="";
                   currentUser=(String)session.getAttribute("USERID");
                   if((currentUser==null)||(currentUser.equals(""))){
                      response.sendRedirect("Default.jsp");
                     return;
                   }
                   String flduser_login="";
                   String flduser_password="";
                   String flduser_password2="";
                   String fldname="";
                   String fldemail="";
                   String fldaddress="";
                   String fldcity="";
                   String fldstate_id="";
                   String fldzip="";
                   String fldage="";
                   String fldgender="";
                   String fldeducation="";
                   String fldincome="";
                   String fldnotes="";
                   String flduser_id="";
                   String sMyDetailsErr = "";

⌨️ 快捷键说明

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