📄 hotspotform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.shandong.struts.form;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
import com.shandong.util.FileUploadHelper;
/**
* MyEclipse Struts Creation date: 12-09-2007
*
* XDoclet definition:
*
* @struts.form name="hotspotForm"
*/
public class HotspotForm extends ActionForm {
/*
* Generated fields
*/
/** id property */
protected String id;
/** info property */
protected String info;
/** video property */
protected FormFile video;
/** name property */
protected String name;
/*
* Generated Methods
*/
/**
* Method validate
*
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
ActionErrors errors = new ActionErrors();
if (name == null || "".equals(name)) {
ActionError error = new ActionError("errors.name.empty");
errors.add("name", error);
}
if (video != null && !"".equals(video.getFileName())) {
List allowedTypes = FileUploadHelper.getAllowedTypes(request
.getRealPath("/WEB-INF")
+ "/config.properties");
if (!allowedTypes.contains(video.getContentType())
&& !allowedTypes.contains(FileUploadHelper.getExtension(
video.getFileName()).toLowerCase())) {
ActionError error = new ActionError(
"errors.video.type_not_allowed");
errors.add("video", error);
}
}
return errors;
}
/**
* Method reset
*
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* Returns the info.
*
* @return String
*/
public String getInfo() {
return info;
}
/**
* Set the info.
*
* @param info
* The info to set
*/
public void setInfo(String info) {
this.info = info;
}
/**
* Returns the video.
*
* @return FormFile
*/
public FormFile getVideo() {
return video;
}
/**
* Set the video.
*
* @param video
* The video to set
*/
public void setVideo(FormFile video) {
this.video = video;
}
/**
* Returns the name.
*
* @return String
*/
public String getName() {
return name;
}
/**
* Set the name.
*
* @param name
* The name to set
*/
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -