KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > micronova > util > codec > CodecJSP


1 /*
2
3 Copyright 2003-2007 MicroNova (R)
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or
7 without modification, are permitted provided that the following
8 conditions are met:
9
10     * Redistributions of source code must retain the above copyright
11     notice, this list of conditions and the following disclaimer.
12
13     * Redistributions in binary form must reproduce the above copyright
14     notice, this list of conditions and the following disclaimer in the
15     documentation and/or other materials provided with the distribution.
16
17     * Neither the name of MicroNova nor the names of its contributors
18     may be used to endorse or promote products derived from this
19     software without specific prior written permission.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 POSSIBILITY OF SUCH DAMAGE.
32
33 */

34
35
36 package com.micronova.util.codec;
37
38 import java.io.*;
39 import java.util.*;
40 import java.util.regex.*;
41 import javax.servlet.*;
42 import javax.servlet.jsp.*;
43 import javax.servlet.http.*;
44 import com.micronova.util.*;
45 import com.micronova.jsp.tag.*;
46 import org.apache.commons.logging.Log;
47 import org.apache.commons.logging.LogFactory;
48 import org.apache.taglibs.standard.tag.common.core.Util;
49
50 /** JSP codecs */
51
52 public class CodecJSP extends Codec
53 {
54     /** evaluates EL or map of EL */
55
56     public static Object JavaDoc eval(PageContext pageContext, Object JavaDoc object, Pattern pattern, Object JavaDoc environment, String JavaDoc evalCodec, boolean recursive, boolean allowGroup) throws Exception JavaDoc
57     {
58         if (object != null)
59         {
60             Object JavaDoc valueVarSaved = null;
61             boolean isValueVarChanged = false;
62
63             try
64             {
65                 EL el = new EL(pageContext, evalCodec);
66                 
67                 valueVarSaved = pageContext.getAttribute(YuzuTag.VALUEVAR);
68                 
69                 if (environment != null)
70                 {
71                     EL.setPageAttribute(pageContext, YuzuTag.VALUEVAR, new NestedMap(environment));
72                 }
73
74                 isValueVarChanged = true;
75
76                 if (object instanceof NestedMap)
77                 {
78                     NestedMap params = (NestedMap)((NestedMap)object).get("__param");
79                     NestedMap evaluatedMap = new NestedMap();
80                     
81                     Iterator iterator = params.entrySet().iterator();
82
83                     while (iterator.hasNext())
84                     {
85                         Map.Entry entry = (Map.Entry)iterator.next();
86
87                         String JavaDoc key = Template.render(entry.getKey().toString(), pattern, 1, el, null, recursive, allowGroup).toString();
88
89                         Object JavaDoc value = entry.getValue();
90
91                         if (value instanceof String JavaDoc)
92                         {
93                             value = Template.render(value.toString(), pattern, 1, el, null, recursive, allowGroup);
94                         }
95
96                         evaluatedMap.setElement(key, value);
97                     }
98                     
99                     object = evaluatedMap;
100                 }
101                 else
102                 {
103                     object = Template.render(object.toString(), pattern, 1, el, null, recursive, allowGroup);
104                 }
105             }
106             catch (Exception JavaDoc e)
107             {
108                 throw e;
109             }
110             finally
111             {
112                 if (isValueVarChanged)
113                 {
114                     EL.setPageAttribute(pageContext, YuzuTag.VALUEVAR, valueVarSaved);
115                 }
116             }
117         }
118
119         return object;
120     }
121
122     /** keys for eval control map */
123
124     public final static String JavaDoc PATTERN = "pattern";
125     public final static String JavaDoc RECURSIVE = "recursive";
126     public final static String JavaDoc ALLOWGROUP = "allowGroup";
127     public final static String JavaDoc ENVIRONMENT = "environment";
128     public final static String JavaDoc EVALCODEC = "evalCodec";
129
130     /** evaluates EL or map of EL using control map */
131
132     public static Object JavaDoc eval(Object JavaDoc context, Object JavaDoc object, Object JavaDoc control) throws Exception JavaDoc
133     {
134         if (object != null)
135         {
136             Object JavaDoc valueVarSaved = null;
137             boolean isValueVarChanged = false;
138
139             PageContext pageContext = (PageContext)context;
140
141             NestedMap controlMap = new NestedMap(control);
142
143             Pattern pattern = EL.getPattern(controlMap.get(PATTERN));
144             
145             if (pattern == null)
146             {
147                 pattern = EL.defaultPatternEval;
148             }
149             
150             boolean recursive = (TypeUtil.isBoolean(controlMap.get(RECURSIVE, Boolean.FALSE))).booleanValue();
151             boolean allowGroup = (TypeUtil.isBoolean(controlMap.get(ALLOWGROUP, Boolean.FALSE))).booleanValue();
152             Object JavaDoc environment = controlMap.get(ENVIRONMENT);
153             String JavaDoc evalCodec = controlMap.getString(EVALCODEC);
154             
155             object = eval(pageContext, object, pattern, environment, evalCodec, recursive, allowGroup);
156         }
157
158         return object;
159     }
160
161     /** evaluate using default arguments */
162
163     public static Object JavaDoc eval(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
164     {
165         return eval(context, object, null);
166     }
167
168     /** encodes URL */
169
170     public static Object JavaDoc encodeURL(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
171     {
172         if (object != null)
173         {
174             object = ((HttpServletResponse)((PageContext)context).getResponse()).encodeURL(object.toString());
175         }
176
177         return object;
178     }
179
180     /** encodes redirect URL */
181
182     public static Object JavaDoc encodeRedirectURL(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
183     {
184         if (object != null)
185         {
186             object = ((HttpServletResponse)((PageContext)context).getResponse()).encodeRedirectURL(object.toString());
187         }
188
189         return object;
190     }
191
192     /** returns real path */
193
194     public static Object JavaDoc getRealPath(Object JavaDoc context, Object JavaDoc object)
195     {
196         if (object != null)
197         {
198             object = (((PageContext)context).getServletContext()).getRealPath(object.toString());
199         }
200
201         return object;
202     }
203
204     /** returns resource URL */
205
206     public static Object JavaDoc getResource(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
207     {
208         if (object != null)
209         {
210             object = (((PageContext)context).getServletContext()).getResource(object.toString());
211         }
212
213         return object;
214     }
215
216     /** returns mimetype */
217
218     public static Object JavaDoc getMimeType(Object JavaDoc context, Object JavaDoc object)
219     {
220         if (object != null)
221         {
222             object = (((PageContext)context).getServletContext()).getMimeType(object.toString());
223         }
224
225         return object;
226     }
227
228     /** creates a dynamic map */
229
230     public static Object JavaDoc dynamicMap(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
231     {
232         return new ELMap((PageContext)context, object);
233     }
234
235     /** creates a dynamic iterator */
236
237     public static Object JavaDoc dynamicIterator(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
238     {
239         return new ELIterator((PageContext)context, object);
240     }
241
242     /** applies given codec */
243
244     public static Object JavaDoc applyCodec(Object JavaDoc context, Object JavaDoc object, Object JavaDoc codec) throws Exception JavaDoc
245     {
246         return EL.applyCodec((PageContext)context, EL.replaceEvalEscape(codec.toString()), object);
247     }
248
249     /** applies filter */
250
251     public static Object JavaDoc applyFilter(Object JavaDoc context, Object JavaDoc object, Object JavaDoc filter) throws Exception JavaDoc
252     {
253         NestedMap filterMap = new NestedMap(filter);
254
255         String JavaDoc include = EL.replaceEvalEscape(filterMap.getString(EL.INCLUDE, "true"));
256         String JavaDoc breakExpression = EL.replaceEvalEscape(filterMap.getString(EL.BREAK));
257         String JavaDoc apply = EL.replaceEvalEscape(filterMap.getString(EL.APPLY));
258         String JavaDoc applyCodec = EL.replaceEvalEscape(filterMap.getString(EL.APPLYCODEC));
259         
260         return EL.applyFilter((PageContext)context, object, include, breakExpression, apply, applyCodec);
261     }
262
263     /** converts relative path (not string with a "/") to absolute, if necessary */
264
265     public static Object JavaDoc getPath(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
266     {
267         String JavaDoc path = null;
268
269         if (object != null)
270         {
271             PageContext pageContext = (PageContext)context;
272             
273             path = object.toString();
274
275             if (!path.startsWith("/"))
276             {
277                 path = ((HttpServletRequest)pageContext.getRequest()).getServletPath().replaceFirst("/[^/]*$", "") + "/" + path;
278             }
279         }
280             
281         return path;
282     }
283
284     public static final String JavaDoc RETURNPROPERTY = com.micronova.jsp.tag.CallTag.RETURNPROPERTY;
285     public static final String JavaDoc VALUEPROPERTY = com.micronova.jsp.tag.CallTag.VALUEPROPERTY;
286     public static final String JavaDoc BODYPROPERTY = com.micronova.jsp.tag.CallTag.BODYPROPERTY;
287
288     /** calls a JSP */
289
290     public static Object JavaDoc call(Object JavaDoc context, Object JavaDoc object, Object JavaDoc control) throws Exception JavaDoc
291     {
292         if (object != null)
293         {
294             PageContext pageContext = (PageContext)context;
295             NestedMap controlMap = TypeUtil.isNestedMap(control);
296
297             String JavaDoc path = (String JavaDoc)getPath(context, controlMap.get("path"));
298             String JavaDoc contextPath = controlMap.getString("contextPath");
299             String JavaDoc bodyParameter = controlMap.getString("bodyParameter", BODYPROPERTY);
300
301             NestedMap map = TypeUtil.isNestedMap(controlMap.get("parameter"));
302
303             if (object instanceof NestedMap)
304             {
305                 map.copyFromSource(object);
306             }
307             else
308             {
309                 String JavaDoc body = (String JavaDoc)TypeUtil.isString(object);
310
311                 if (!TypeUtil.isEmptyString(body))
312                 {
313                     map.put(bodyParameter, body);
314                 }
315             }
316
317             Map returnMap = map.getSubMap(RETURNPROPERTY);
318
319             returnMap.put(VALUEPROPERTY, null);
320
321             object = com.micronova.util.servlet.HttpDispatch.include(pageContext, path, contextPath, map);
322
323             Object JavaDoc returnValue = returnMap.get(VALUEPROPERTY);
324
325             if (!TypeUtil.isEmptyString(returnValue))
326             {
327                 object = returnValue;
328             }
329         }
330
331         return object;
332     }
333
334     public static Object JavaDoc _log(PageContext pageContext, Object JavaDoc object, String JavaDoc destination, String JavaDoc category) throws Exception JavaDoc
335     {
336         if (object != null)
337         {
338             if ("log".equals(destination))
339             {
340                 ServletContext context = pageContext.getServletContext();
341
342                 context.log(object.toString());
343             }
344             else if ("out".equals(destination))
345             {
346                 System.out.println(object.toString());
347             }
348             else if ("err".equals(destination))
349             {
350                 System.err.println(object.toString());
351             }
352             else
353             {
354                 Log log = LogFactory.getLog(category);
355
356                 if ("trace".equals(destination))
357                 {
358                     log.trace(object.toString());
359                 }
360                 else if ("debug".equals(destination))
361                 {
362                     log.debug(object.toString());
363                 }
364                 else if ("info".equals(destination))
365                 {
366                     log.info(object.toString());
367                 }
368                 else if ("warn".equals(destination))
369                 {
370                     log.warn(object.toString());
371                 }
372                 else if ("error".equals(destination))
373                 {
374                     log.error(object.toString());
375                 }
376                 else if ("fatal".equals(destination))
377                 {
378                     log.fatal(object.toString());
379                 }
380             }
381         }
382
383         return object;
384     }
385
386     /** simple log facility */
387
388     public static Object JavaDoc log(Object JavaDoc context, Object JavaDoc object, Object JavaDoc control) throws Exception JavaDoc
389     {
390         if (object != null)
391         {
392             PageContext pageContext = (PageContext)context;
393             NestedMap controlMap = TypeUtil.isNestedMap(control);
394
395             String JavaDoc destination = controlMap.getString("destination", "log");
396             String JavaDoc category = controlMap.getString("category", "");
397
398             object = _log(pageContext, object, destination, category);
399         }
400
401         return object;
402     }
403
404     public static Object JavaDoc log(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
405     {
406         return log(context, object, null);
407     }
408
409     /** sorts a collection */
410
411     public static Object JavaDoc sort(Object JavaDoc context, Object JavaDoc object, Object JavaDoc comparatorSpec) throws Exception JavaDoc
412     {
413         if (object != null)
414         {
415             List list = TypeUtil.isList(object);
416             
417             if (list != null)
418             {
419                 if (comparatorSpec != null)
420                 {
421                     ELComparator comparator = new ELComparator((PageContext)context, comparatorSpec);
422
423                     Collections.sort(list, comparator);
424                 }
425                 else
426                 {
427                     Collections.sort(list);
428                 }
429             }
430             
431             object = list;
432         }
433
434         return object;
435     }
436
437     public static Object JavaDoc sort(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
438     {
439         return sort(context, object, null);
440     }
441
442     /** finds max in a collection using given comparator */
443
444     public static Object JavaDoc max(Object JavaDoc context, Object JavaDoc object, Object JavaDoc comparatorSpec) throws Exception JavaDoc
445     {
446         if (object != null)
447         {
448             if (comparatorSpec != null)
449             {
450                 ELComparator comparator = new ELComparator((PageContext)context, comparatorSpec);
451
452                 object = Collections.max((Collection)object, comparator);
453             }
454             else
455             {
456                 object = Collections.max((Collection)object);
457             }
458         }
459
460         return object;
461     }
462
463     public static Object JavaDoc max(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
464     {
465         return max(context, object, null);
466     }
467
468     /** finds min in a collection using given comparator */
469
470     public static Object JavaDoc min(Object JavaDoc context, Object JavaDoc object, Object JavaDoc comparatorSpec) throws Exception JavaDoc
471     {
472         if (object != null)
473         {
474             if (comparatorSpec != null)
475             {
476                 ELComparator comparator = new ELComparator((PageContext)context, comparatorSpec);
477
478                 object = Collections.min((Collection)object, comparator);
479             }
480             else
481             {
482                 object = Collections.min((Collection)object);
483             }
484         }
485
486         return object;
487     }
488
489     public static Object JavaDoc min(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
490     {
491         return min(context, object, null);
492     }
493
494     /** perform binary search on given object as a List using given comparatorSpec */
495
496     public static Object JavaDoc binarySearch(Object JavaDoc context, Object JavaDoc object, Object JavaDoc key, Object JavaDoc comparatorSpec) throws Exception JavaDoc
497     {
498         List list = TypeUtil.isList(object);
499         
500         int index = -1;
501
502         if (list != null)
503         {
504             if (comparatorSpec != null)
505             {
506                 ELComparator comparator = new ELComparator((PageContext)context, comparatorSpec);
507                 
508                 index = Collections.binarySearch(list, key, comparator);
509             }
510             else
511             {
512                 index = Collections.binarySearch(list, key);
513             }
514         }
515
516         return new Integer JavaDoc(index);
517     }
518
519     public static Object JavaDoc binarySearch(Object JavaDoc context, Object JavaDoc object, Object JavaDoc key) throws Exception JavaDoc
520     {
521         return binarySearch(context, object, key, null);
522     }
523
524     /** create message map */
525
526     public static Object JavaDoc getMessageMap(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
527     {
528         MessageMap messageMap = new MessageMap((PageContext)context);
529
530         if (object != null)
531         {
532             BeanUtil.fill(messageMap, TypeUtil.isNestedMap(object));
533         }
534
535         return messageMap;
536     }
537
538     public static Object JavaDoc getMessageMap(Object JavaDoc context) throws Exception JavaDoc
539     {
540         return getMessageMap(context, null);
541     }
542
543     /** create EL comparator */
544
545     public static Object JavaDoc comparator(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
546     {
547         return new ELComparator((PageContext)context, TypeUtil.isNestedMap(object));
548     }
549
550     /** flushes stream */
551
552     public static Object JavaDoc flush(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
553     {
554         Writer writer = ((PageContext)context).getOut();
555
556         if (object instanceof Writer)
557         {
558             writer = (Writer)object;
559         }
560         
561         writer.flush();
562
563         return object;
564     }
565
566     public static Object JavaDoc flush(Object JavaDoc context) throws Exception JavaDoc
567     {
568         return flush(context, null);
569     }
570
571     /** clears output */
572
573     public static Object JavaDoc clear(Object JavaDoc context, Object JavaDoc object) throws Exception JavaDoc
574     {
575         JspWriter jspWriter = ((PageContext)context).getOut();
576
577         if (object instanceof JspWriter)
578         {
579             jspWriter = (JspWriter)object;
580         }
581
582         jspWriter.clear();
583
584         return object;
585     }
586
587     public static Object JavaDoc clear(Object JavaDoc context) throws Exception JavaDoc
588     {
589         return clear(context, null);
590     }
591
592     /** returns session as PageContextMap for the session if there is a session, otherwise null */
593
594     public static Object JavaDoc hasSession(Object JavaDoc context) throws Exception JavaDoc
595     {
596         PageContext pageContext = (PageContext)context;
597
598         HttpSession session = ((HttpServletRequest)pageContext.getRequest()).getSession(false);
599
600         if (session != null)
601         {
602             return new PageContextMap(pageContext, PageContext.SESSION_SCOPE);
603         }
604         else
605         {
606             return null;
607         }
608     }
609
610     /** invalidates current session and creates a new one with same session attributes returned as HttpSessionMap, if any */
611
612     public static Object JavaDoc newSession(Object JavaDoc context) throws Exception JavaDoc
613     {
614         PageContext pageContext = (PageContext)context;
615
616         HttpServletRequest request = ((HttpServletRequest)pageContext.getRequest());
617
618         HttpSession session = request.getSession(false);
619
620         NestedMap currentSessionMap = null;
621
622         if (session != null)
623         {
624             currentSessionMap = new PageContextMap(pageContext, PageContext.SESSION_SCOPE);
625             session.invalidate();
626         }
627
628         session = request.getSession(true);
629
630         NestedMap sessionMap = new PageContextMap(pageContext, PageContext.SESSION_SCOPE);
631
632         if (currentSessionMap != null)
633         {
634             sessionMap.copyFromSource(currentSessionMap);
635         }
636
637         return sessionMap;
638     }
639
640     /** invalidates current session if any. Returns null. */
641
642     public static Object JavaDoc invalidateSession(Object JavaDoc context) throws Exception JavaDoc
643     {
644         HttpServletRequest request = ((HttpServletRequest)((PageContext)context).getRequest());
645
646         HttpSession session = request.getSession(false);
647
648         if (session != null)
649         {
650             session.invalidate();
651         }
652
653         return null;
654     }
655
656     /** returns a shallow copy of current call stack (reversed so that the first element is the closest ancestor) */
657
658     public static Object JavaDoc getCallStack(Object JavaDoc context) throws Exception JavaDoc
659     {
660         PageContext pageContext = (PageContext)context;
661
662         List list = new ArrayList(com.micronova.jsp.tag.YuzuTag.getCallStack(pageContext));
663
664         Collections.reverse(list);
665
666         return list;
667     }
668
669     /** returns attribute map for given scope */
670
671     public static Object JavaDoc getAttributes(Object JavaDoc context, Object JavaDoc vars, Object JavaDoc scopeName) throws Exception JavaDoc
672     {
673         int scope = PageContext.PAGE_SCOPE;
674
675         if (scopeName != null)
676         {
677             scope = Util.getScope(scopeName.toString());
678         }
679
680         List list = TypeUtil.isStringList(vars, ',', '\\');
681
682         return new PageContextMap((PageContext)context, scope, list);
683     }
684
685     public static Object JavaDoc getAttributes(Object JavaDoc context, Object JavaDoc vars) throws Exception JavaDoc
686     {
687         return getAttributes(context, vars, null);
688     }
689
690     public static Object JavaDoc getAttributes(Object JavaDoc context) throws Exception JavaDoc
691     {
692         return getAttributes(context, null);
693     }
694
695     /** extract map key/values into given scope and returns source */
696
697     public static Object JavaDoc putAttributes(Object JavaDoc context, Object JavaDoc source, Object JavaDoc scopeName) throws Exception JavaDoc
698     {
699         PageContext pageContext = (PageContext)context;
700
701         NestedMap sourceMap = TypeUtil.isNestedMap(source);
702
703         Iterator iterator = sourceMap.entrySet().iterator();
704
705         int scope = PageContext.PAGE_SCOPE;
706
707         if (scopeName != null)
708         {
709             scope = Util.getScope(scopeName.toString());
710         }
711
712         while (iterator.hasNext())
713         {
714             Map.Entry entry = (Map.Entry)iterator.next();
715
716             YuzuTag.setScopedAttribute(pageContext, entry.getKey().toString(), entry.getValue(), scope);
717         }
718
719         return source;
720     }
721
722     public static Object JavaDoc putAttributes(Object JavaDoc context, Object JavaDoc source) throws Exception JavaDoc
723     {
724         return putAttributes(context, source, null);
725     }
726
727     /** Saves current pageContext as rootPageContext in requestScope. This becomes the root pageContext in the call stack (see getCallStack()). If doesOverwrite (boolean) is true, then always replaces the value; otherwise only when the current value is null (default is false). Returns the value before replacement.*/
728
729     public static Object JavaDoc setRootPageContext(Object JavaDoc context, Object JavaDoc doesOverwrite) throws Exception JavaDoc
730     {
731         PageContext pageContext = (PageContext)context;
732
733         Object JavaDoc currentRootPageContext = pageContext.getRequest().getAttribute(YuzuTag.ROOTPAGECONTEXT);
734
735         if ((currentRootPageContext == null) || (TypeUtil.isTrue(doesOverwrite)))
736         {
737             pageContext.getRequest().setAttribute(YuzuTag.ROOTPAGECONTEXT, pageContext);
738         }
739
740         return currentRootPageContext;
741     }
742
743     public static Object JavaDoc setRootPageContext(Object JavaDoc context) throws Exception JavaDoc
744     {
745         return setRootPageContext(context, Boolean.FALSE);
746     }
747
748     /** retrieves pageScope variables as AttributeMap for entry in the call stack at given index (default 0). This can be used to get/set particular pageScope variables. */
749
750     public static Object JavaDoc getPageScope(Object JavaDoc context, Object JavaDoc indexSpec) throws Exception JavaDoc
751     {
752         List callStack = (List)getCallStack(context);
753         int index = TypeUtil.isInteger(indexSpec).intValue();
754         PageContext targetPageContext = (PageContext)TypeUtil.isNestedMap(callStack.get(index)).get(YuzuTag.PAGECONTEXT);
755         return getAttributes(targetPageContext);
756     }
757
758     public static Object JavaDoc getPageScope(Object JavaDoc context) throws Exception JavaDoc
759     {
760         return getPageScope(context, new Integer JavaDoc(0));
761     }
762 }
763
Popular Tags