1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.module.blossom.preexecution; |
35 |
|
|
36 |
|
import javax.servlet.http.HttpServletRequest; |
37 |
|
import javax.servlet.http.HttpServletResponse; |
38 |
|
|
39 |
|
import org.springframework.web.servlet.HandlerExecutionChain; |
40 |
|
import org.springframework.web.servlet.ModelAndView; |
41 |
|
import org.springframework.web.servlet.mvc.Controller; |
42 |
|
|
43 |
|
import info.magnolia.module.blossom.dispatcher.BlossomDispatcher; |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
@since |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 4 |
Complexity Density: 0.36 |
|
50 |
|
public class ModelAndViewGrabbingController implements Controller { |
51 |
|
|
52 |
|
private PreexecutionContext preexecutionContext; |
53 |
|
private HandlerExecutionChain handlerExecutionChain; |
54 |
|
private DirectRenderingVoter directRenderingVoter; |
55 |
|
private BlossomDispatcher dispatcher; |
56 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
57 |
0 |
public ModelAndViewGrabbingController(PreexecutionContext preexecutionContext, HandlerExecutionChain handlerExecutionChain, DirectRenderingVoter directRenderingVoter, BlossomDispatcher dispatcher) {... |
58 |
0 |
this.preexecutionContext = preexecutionContext; |
59 |
0 |
this.handlerExecutionChain = handlerExecutionChain; |
60 |
0 |
this.directRenderingVoter = directRenderingVoter; |
61 |
0 |
this.dispatcher = dispatcher; |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
64 |
0 |
@Override... |
65 |
|
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { |
66 |
|
|
67 |
0 |
ModelAndView mv = dispatcher.executeChain(handlerExecutionChain, request, response); |
68 |
|
|
69 |
|
|
70 |
0 |
if (mv == null) { |
71 |
0 |
return null; |
72 |
|
} |
73 |
|
|
74 |
|
|
75 |
0 |
if (directRenderingVoter.renderDirectly(mv, request, response)) { |
76 |
0 |
return mv; |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
0 |
preexecutionContext.setModelAndView(mv); |
81 |
|
|
82 |
|
|
83 |
0 |
return null; |
84 |
|
} |
85 |
|
} |