requestutil.java
来自「一个留言板 系统平台: JSP+SQLServer 支持开通无限个数的留言」· Java 代码 · 共 42 行
JAVA
42 行
/* * RequestUtil.java * * Created on 2006年7月25日, 下午4:13 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package tot.util;import javax.servlet.*;import javax.servlet.http.*;/** * * @author Administrator */public class RequestUtil { /** Creates a new instance of RequestUtil */ public RequestUtil() { } //get int value public static int getInt(HttpServletRequest request,String parameter){ int tempInt=0; if(request.getParameter(parameter)!=null){ tempInt=Integer.parseInt(request.getParameter(parameter)); } return tempInt; } //get string value public static String getString(HttpServletRequest request,String parameter){ String tempString=null; if(request.getParameter(parameter)!=null){ tempString=request.getParameter(parameter); tempString=tempString.replace('\'', ' '); tempString=tempString.replaceAll("and",""); } return tempString; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?