KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > workflow > LayoutRequestProcessor


1 package fr.improve.struts.taglib.layout.workflow;
2
3 import java.io.IOException JavaDoc;
4 import javax.servlet.ServletException JavaDoc;
5 import javax.servlet.http.HttpServletRequest JavaDoc;
6 import javax.servlet.http.HttpServletResponse JavaDoc;
7 import javax.servlet.http.HttpSession JavaDoc;
8
9 import org.apache.struts.config.ForwardConfig;
10 import org.apache.struts.tiles.TilesRequestProcessor;
11
12 import fr.improve.struts.taglib.layout.sort.SortUtil;
13 import fr.improve.struts.taglib.layout.treeview.TreeViewReconciler;
14
15 /**
16  * This is the struts-layout request processor for Struts.
17  *
18  * The processor make a cache of the datas in the request scope
19  * so that the page can be redisplayed without invoking the application.
20  *
21  * This processor is compatible with the Tiles processor.
22  *
23  * @author jnribette
24  */

25 public class LayoutRequestProcessor extends TilesRequestProcessor {
26     public static final String JavaDoc CONTEXT_KEY = "fr.improve.struts.taglib.layout.workflow.LayoutRequestProcessor.CONTEXT_KEY";
27     private static final String JavaDoc CONTEXT_REQUIRED = "fr.improve.struts.taglib.layout.workflow.LayoutRequestProcessor.CONTEXT_REQUIRED";
28     
29     protected void processForwardConfig(HttpServletRequest JavaDoc request,
30                                         HttpServletResponse JavaDoc response,
31                                         ForwardConfig forward)
32         throws IOException JavaDoc, ServletException JavaDoc {
33         // Required by struts contract
34
if (forward != null) {
35             // Reconcile open/close treeview.
36
TreeViewReconciler.reconceileFromMenu(request, response);
37                         
38             // Process the forward.
39
super.processForwardConfig(request, response, forward);
40             
41             HttpSession JavaDoc lc_session = request.getSession(false);
42             if (lc_session!=null) {
43                 SortUtil lc_sortUtil = (SortUtil) lc_session.getAttribute(SortUtil.SORTUTIL_KEY);
44                 if (lc_sortUtil!=null && "aaa".equals(request.getAttribute(SortUtil.SORTUTIL_KEY + "aaa"))) {
45                     lc_sortUtil.initSortUtil(request, forward.getPath());
46                 }
47             }
48         }
49                                         
50         // Update the layout context.
51
//updateContext(request, forward.getPath());
52
}
53 }
54
Popular Tags