01: /*
02: * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
03: *
04: * Redistribution and use in source and binary forms, with or
05: * without modification, are permitted provided that the following
06: * conditions are met:
07: *
08: * - Redistributions of source code must retain the above copyright
09: * notice, this list of conditions and the following disclaimer.
10: *
11: * - Redistribution in binary form must reproduce the above
12: * copyright notice, this list of conditions and the following
13: * disclaimer in the documentation and/or other materials
14: * provided with the distribution.
15: *
16: * Neither the name of Sun Microsystems, Inc. or the names of
17: * contributors may be used to endorse or promote products derived
18: * from this software without specific prior written permission.
19: *
20: * This software is provided "AS IS," without a warranty of any
21: * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22: * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24: * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
25: * DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR
26: * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE OR
27: * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
28: * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
29: * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
30: * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
31: * THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
32: * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
33: *
34: * You acknowledge that this software is not designed, licensed or
35: * intended for use in the design, construction, operation or
36: * maintenance of any nuclear facility.
37: */
38:
39: package org.apache.cocoon.faces.samples.carstore;
40:
41: import javax.faces.context.FacesContext;
42: import javax.faces.event.AbortProcessingException;
43: import javax.faces.event.PhaseId;
44: import javax.faces.event.ValueChangeEvent;
45: import javax.faces.event.ValueChangeListener;
46:
47: public class FirstNameChanged extends Object implements
48: ValueChangeListener {
49:
50: public void processValueChange(ValueChangeEvent event)
51: throws AbortProcessingException {
52: if (null != event.getNewValue()) {
53: FacesContext.getCurrentInstance().getExternalContext()
54: .getSessionMap().put("firstName",
55: event.getNewValue());
56: }
57: }
58:
59: public PhaseId getPhaseId() {
60: return PhaseId.ANY_PHASE;
61: }
62:
63: }
|