IndexForm.java
资源名称:Myblog.rar [点击查看]
上传用户:wlfwy2004
上传日期:2016-12-12
资源大小:33978k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
Java
- package com.opensource.blog.web.form;
- import org.apache.struts.action.*;
- import javax.servlet.http.HttpServletRequest;
- import org.apache.commons.lang.*;
- public class IndexForm
- extends ActionForm {
- private long id;
- private String username;
- public long getId() {
- return id;
- }
- public void setId(long id) {
- this.id = id;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- public String getUsername() {
- return username;
- }
- public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
- ActionErrors errors = new ActionErrors();
- if (StringUtils.isBlank(this.getUsername())) {
- errors.add("error.parametererror", new ActionMessage("error.parametererror"));
- }
- return errors;
- }
- public void reset(ActionMapping actionMapping, HttpServletRequest servletRequest) {
- }
- }