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