当前位置: 代码迷 >> Web前端 >> GWT client 端印证
  详细解决方案

GWT client 端印证

热度:213   发布时间:2012-09-01 09:33:02.0
GWT client 端验证
import com.google.gwt.regexp.shared.RegExp;

	/** 获取用户设置的当前页码 */
	public int getCurrentaBoxVal() {
		int pageNum = 1;
		String currentPageBoxVal = currentPageBox.getValue().trim();
		String patternStr = "^\\d+$";

		if (null != currentPageBoxVal && currentPageBoxVal.length() > 0) {
			RegExp regExp = RegExp.compile(patternStr);
			boolean matchFound = regExp.test(currentPageBoxVal);
			if (matchFound) {
				pageNum = Integer.valueOf(currentPageBoxVal);
			} else {
				Window.alert("Please input positive integer !");
			}
		} else {
			pageNum = currentPageNumber;
		}

		return pageNum;
	}







.
  相关解决方案