JSP easy GetParameter

xiaoxiao2021-03-06  50

Private static final string getParam (servletRequest request, string name, string defval) {string param = request.getParameter (Name); return (param! = null? param: defval);}

private static final int getParam (ServletRequest request, String name, int defval) {String param = request.getParameter (name); int value = defval; if (param = null!) {try {value = Integer.parseInt (param); } Catch (Numberformatexception Ignore) {}} Return Value;

转载请注明原文地址:https://www.9cbs.com/read-115060.html

New Post(0)