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 * Invokes the application
30 */
31 public class InvokeApplicationInterceptor extends FacesInterceptor {
32
33 private static final long serialVersionUID = -7388153356410171208L;
34
35 /***
36 * Invoke Application (JSF.2.2.5)
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 invokeApplication");
49
50 informPhaseListenersBefore(facesContext, PhaseId.INVOKE_APPLICATION);
51
52 try {
53 if (isResponseComplete(facesContext, "invokeApplication", true)) {
54
55 return true;
56 }
57 if (shouldRenderResponse(facesContext, "invokeApplication", true)) {
58 skipFurtherProcessing = true;
59 }
60
61 facesContext.getViewRoot().processApplication(facesContext);
62 } finally {
63 informPhaseListenersAfter(facesContext, PhaseId.INVOKE_APPLICATION);
64 }
65
66 if (isResponseComplete(facesContext, "invokeApplication", false)
67 || shouldRenderResponse(facesContext, "invokeApplication",
68 false)) {
69
70
71 skipFurtherProcessing = true;
72 }
73
74 if (!skipFurtherProcessing && log.isTraceEnabled())
75 log.trace("exiting invokeApplication ");
76
77 return skipFurtherProcessing;
78 }
79 }