All pastes #395923 Raw Edit

klopfdreh

public text v1 · immutable
·published 2007-03-15 11:59 UTC
rendered paste body
	public void validate(FacesContext context, UIComponent component,
			Object value) throws ValidatorException {

		// coerce the value to an int
		try {
			System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+value.toString());
			
			StringTokenizer st = new StringTokenizer(value.toString(),".");
			String[] userDate = new String[3];
			for (int i = 0 ; i < 4 ; i++){
				userDate[i] = st.nextToken();
			}
			System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+userDate.length);
			gc.set(Integer.parseInt(userDate[0]),
				   Integer.parseInt(userDate[1]), 
				   Integer.parseInt(userDate[2]));
			
		} catch (NumberFormatException e) {
			FacesMessage msg = new FacesMessage("Your date may be incorrect.");
			throw new ValidatorException(msg);
		}
	}