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