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