?? indexform.java
字號:
/**
*
*/
package javafish.web.forms;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;
/**
* @author longjiang
* @version 1.0
* <p>這個類是index.jsp對應的ActionForm</p>
*/
public class IndexForm extends ValidatorForm
{
private long id;
private String username;
private String password;
//下面是為了程序的擴展希望實現的功能添加的屬性
private String action;
private String ascordesc;
private String orderby;
private int t;
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getAscordesc() {
return ascordesc;
}
public void setAscordesc(String ascordesc) {
this.ascordesc = ascordesc;
}
public String getOrderby() {
return orderby;
}
public void setOrderby(String orderby) {
this.orderby = orderby;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getT() {
return t;
}
public void setT(int t) {
this.t = t;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
//下面的方法為分頁實現了一些基本方法
public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest) {
ActionErrors errors = new ActionErrors();
if (action == null) {
action = "show";
}
if (orderby == null) {
orderby = "id";
}
if (ascordesc == null) {
ascordesc = "desc";
}
if (page == 0) {
page = 1;
}
return errors;
}
//因為繼承了ValidatorForm此方法可以不用自己實現
public void reset(ActionMapping actionMapping,
HttpServletRequest servletRequest) {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -