/*
Title: Struts : Essential Skills (Essential Skills)
Authors: Steven Holzner
Publisher: McGraw-Hill Osborne Media
ISBN: 0072256591
*/
//ch09_01.jsp
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
Using the Struts Validator
Using the Struts Validator
Submit
Reset
//ch09_04.jsp
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
Here's Your Data...
Here's Your Data...
:
:
:
:
:
:
:
:
:
:
:
package ch09;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;
public final class ch09_02 extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
return mapping.findForward("success");
}
}
package ch09;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;
public final class ch09_03 extends ValidatorForm {
private String byteData = null;
private String shortData = null;
private String integerData = null;
private String longData = null;
private String floatData = null;
private String floatDataRange = null;
private String doubleData = null;
private String dateData = null;
private String creditData = null;
private String cityData = null;
private String zipData = null;
public String getByte()
{
return byteData;
}
public void setByte(String byteData)
{
this.byteData = byteData;
}
public String getShort()
{
return shortData;
}
public void setShort(String shortData)
{
this.shortData = shortData;
}
public String getInteger()
{
return integerData;
}
public void setInteger(String integerData)
{
this.integerData = integerData;
}
public String getLong()
{
return longData;
}
public void setLong(String longData)
{
this.longData = longData;
}
public String getFloat()
{
return floatData;
}
public void setFloat(String floatData)
{
this.floatData = floatData;
}
public String getFloatRange()
{
return floatDataRange;
}
public void setFloatRange(String floatDataRange)
{
this.floatDataRange = floatDataRange;
}
public String getDouble()
{
return doubleData;
}
public void setDouble(String doubleData)
{
this.doubleData = doubleData;
}
public String getDate()
{
return dateData;
}
public void setDate(String dateData)
{
this.dateData = dateData;
}
public String getCreditCard()
{
return creditData;
}
public void setCreditCard(String creditData)
{
this.creditData = creditData;
}
public String getCity()
{
return cityData;
}
public void setCity(String cityData)
{
this.cityData = cityData;
}
public String getZip()
{
return zipData;
}
public void setZip(String zipData)
{
this.zipData = zipData;
}
public void reset(ActionMapping mapping, HttpServletRequest request)
{
byteData = null;
shortData = null;
integerData = null;
longData = null;
floatData = null;
floatDataRange = null;
doubleData = null;
dateData = null;
creditData = null;
cityData = null;
zipData = null;
}
}
Struts-Essential-Skills-ch09.zip( 1,439 k)