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