)){ ArrayList values="new" ArrayList(); values.add(value); pairs.put(name,values); }catch(Exception e){ java.io.IOException(e.getMessage()); 这个类的功能就是读取并保存form提交的信息,并实现常用的getParameter方法。 package com.hto.servlet; java.io.*; javax.servlet.*; import javax.servlet.http.*; type?s 8:28:20) @author: 钱卫春 UtfBaseServlet extends HttpServlet final PARAMS_ATTR_NAME="PARAMS_ATTR_NAME" GET doGet(HttpServletRequest HTTP POST doPost(HttpServletRequest ServletException, IOException performTask(request, response); getDateParameter(HttpServletRequest Str ing java.sql.Date java.sql.Date.valueOf(value); getDoubleParameter(HttpServletRequest n ame, double Double.parseDouble(value); getFloatParameter(HttpServletRequest nam e, float Float.parseFloat(value); getIntParameter(HttpServletRequest Integer.parseInt(value); 8:43:36) getParameter(HttpServletRequest b oolean ServletException{ if(request.getAttribute(UtfBaseServlet.PARAMS_ATTR_NAME) UTF8ParameterReader params="(UTF8ParameterReader)request.getAttribute(UtfBa" seServlet.PARAMS_ATTR_NAME); (params.getParameter(name) params.getParameter(name); }else{ (request.getParameter(name) request.getParameter(name); if (required) throw new ServletException(?The Parameter ?+name+? Required bu t not provided!?); else defValue; Returns info string. getServletInfo() super.getServletInfo(); 8:52:43) @return javax.servlet.http.HttpServletRequest java.lang.String required defValue int static getTimestampParameter(HttpServletRequest re quest, name, boolean required, 上一页 [1] [2] [3] [4] [5] [6] 下一页 (中华企业文化网)
|