📄 accountprofileform.java
字号:
package com.jdon.jivejdon.presentation.form;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
import com.jdon.jivejdon.model.Account;
import com.jdon.jivejdon.model.message.upload.UploadHelper;
public class AccountProfileForm extends BaseForm {
private Long priofileId;
private FormFile theFile;
private UploadHelper uploadHelper = new UploadHelper();;
private String imagePath = "/upload/image/default.jpg";
private String address;
private int point;
private String contextPath;
private Account account;
public void doValidate(ActionMapping mapping, HttpServletRequest request,List errors) {
if (theFile != null && theFile.getFileSize()!=0) {
String fileName = theFile.getFileName();
if (!uploadHelper.isImage(fileName))errors.add("你选择的文件类型不是图形");
}
}
public Long getPriofileId() {
return priofileId;
}
public void setPriofileId(Long priofileId) {
this.priofileId = priofileId;
}
public FormFile getTheFile() {
return theFile;
}
public void setTheFile(FormFile theFile) {
this.theFile = theFile;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getContextPath() {
return contextPath;
}
public void setContextPath(String contextPath) {
this.contextPath = contextPath;
}
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public int getPoint() {
return point;
}
public void setPoint(int point) {
this.point = point;
}
public Account getAccount() {
return account;
}
public void setAccount(Account account) {
this.account = account;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -