📄 showaddgiftform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.chen.struts.form;
import java.text.ParseException;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
/**
* MyEclipse Struts
* Creation date: 12-25-2008
*
* XDoclet definition:
* @struts.form name="showaddgiftForm"
*/
public class ShowaddgiftForm extends ActionForm {
/*
* Generated fields
*/
/** foregift property */
private Float foregift;
/** price property */
private Float price;
/** begintime property */
private String begintime;
/** username property */
private String username;
/** roomnumber property */
private String roomnumber;
/** endtime property */
private String endtime;
/*
* Generated Methods
*/
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
java.text.SimpleDateFormat sifo = new java.text.SimpleDateFormat("yyyy-MM-dd");
ActionErrors error = new ActionErrors();
try{
java.util.Date estringToDate = sifo.parse(this.endtime);
java.util.Date bstringToDate = sifo.parse(this.begintime);
if((estringToDate.getTime()-bstringToDate.getTime())<=0){
error.add("endtime", new ActionMessage("twotimewrong"));
return error;
}
}catch(ParseException p){
p.printStackTrace();
}
return null;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* Returns the foregift.
* @return Float
*/
public Float getForegift() {
return foregift;
}
/**
* Set the foregift.
* @param foregift The foregift to set
*/
public void setForegift(Float foregift) {
this.foregift = foregift;
}
/**
* Returns the price.
* @return Float
*/
public Float getPrice() {
return price;
}
/**
* Set the price.
* @param price The price to set
*/
public void setPrice(Float price) {
this.price = price;
}
/**
* Returns the begintime.
* @return String
*/
public String getBegintime() {
return begintime;
}
/**
* Set the begintime.
* @param begintime The begintime to set
*/
public void setBegintime(String begintime) {
this.begintime = begintime;
}
/**
* Returns the username.
* @return String
*/
public String getUsername() {
return username;
}
/**
* Set the username.
* @param username The username to set
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Returns the roomnumber.
* @return String
*/
public String getRoomnumber() {
return roomnumber;
}
/**
* Set the roomnumber.
* @param roomnumber The roomnumber to set
*/
public void setRoomnumber(String roomnumber) {
this.roomnumber = roomnumber;
}
/**
* Returns the endtime.
* @return String
*/
public String getEndtime() {
return endtime;
}
/**
* Set the endtime.
* @param endtime The endtime to set
*/
public void setEndtime(String endtime) {
this.endtime = endtime;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -