1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts2.jsf;
23
24 import javax.faces.FacesException;
25 import javax.faces.context.FacesContext;
26 import javax.faces.event.PhaseId;
27
28 /***
29 * Applies the request values to the component tree
30 */
31 public class ApplyRequestValuesInterceptor extends FacesInterceptor {
32
33 private static final long serialVersionUID = -1471180154211835323L;
34
35 /***
36 * Apply Request Values (JSF.2.2.2)
37 *
38 * @param viewId
39 * The view id
40 * @param facesContext
41 * The faces context
42 * @return true, if response is complete
43 */
44 protected boolean executePhase(String viewId, FacesContext facesContext)
45 throws FacesException {
46 boolean skipFurtherProcessing = false;
47 if (log.isTraceEnabled())
48 log.trace("entering applyRequestValues");
49
50 informPhaseListenersBefore(facesContext, PhaseId.APPLY_REQUEST_VALUES);
51
52 try {
53 if (isResponseComplete(facesContext, "applyRequestValues", true)) {
54
55 return true;
56 }
57 if (shouldRenderResponse(facesContext, "applyRequestValues", true)) {
58 skipFurtherProcessing = true;
59 }
60
61 facesContext.getViewRoot().processDecodes(facesContext);
62 } finally {
63 informPhaseListenersAfter(facesContext,
64 PhaseId.APPLY_REQUEST_VALUES);
65 }
66
67 if (isResponseComplete(facesContext, "applyRequestValues", false)
68 || shouldRenderResponse(facesContext, "applyRequestValues",
69 false)) {
70
71
72 skipFurtherProcessing = true;
73 }
74
75 if (!skipFurtherProcessing && log.isTraceEnabled())
76 log.trace("exiting applyRequestValues");
77 return skipFurtherProcessing;
78 }
79 }