Source Code Cross Referenced for CallPageFlow.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » tags » databinding » invoke » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.tags.databinding.invoke 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         *
017:         * $Header:$
018:         */
019:        package org.apache.beehive.netui.tags.databinding.invoke;
020:
021:        import javax.servlet.http.HttpServletRequest;
022:        import javax.servlet.http.HttpServletResponse;
023:
024:        import org.apache.beehive.netui.pageflow.PageFlowUtils;
025:        import org.apache.beehive.netui.pageflow.internal.InternalUtils;
026:        import org.apache.beehive.netui.util.Bundle;
027:        import org.apache.beehive.netui.util.logging.Logger;
028:
029:        /**
030:         * <p>
031:         * Calls methods on the current Page Flow.  If no Controller file is found, an
032:         * {@link ObjectNotFoundException} is thrown and the tag execution fails.
033:         * Any return value is stored in the <code>${pageScope...}</code> data binding context object under the
034:         * attribute specified by the <code>resultId</code> attribute.
035:         * </p>
036:         * <p>
037:         * For example, given a <code>hello</code> method and the following &lt;netui-data:callPageFlow> tag:
038:         * <pre>
039:         * &lt;netui-data:callPageFlow method="hello" resultId="helloMessage"/>
040:         * </pre>
041:         * <p>
042:         * the result of the call is stored in the <code>${pageScope}</code> JSP EL implicit object under
043:         * the attribute <code>helloMessage</code>.  It will be accessible via <code>${pageScope.helloMessage}</code> and
044:         * can be used as:
045:         * <pre>
046:         *     &lt;netui:span value="<b>${pageScope.helloMessage}</b>"/>
047:         * </pre>
048:         * </p>
049:         * <p>
050:         * In JSP scriptlet, the result can be retrieved by calling the <code>getAttribute()</code> method on the
051:         * {@link javax.servlet.jsp.PageContext javax.servlet.jsp.PageContext} object:
052:         * <pre>
053:         *     &lt;%= pageContext.getAttribute("helloMessage") %>
054:         * </pre>
055:         * </p>
056:         *
057:         * @jsptagref.tagdescription
058:         * Calls methods on the current Page Flow.  If no Controller file is found, an
059:         * {@link ObjectNotFoundException} is thrown and the tag execution fails.
060:         * Any return value is stored in the <code>${pageScope...}</code> data binding context object under the
061:         * attribute specified by the <code>resultId</code> attribute.
062:         * <p/>
063:         * <p>
064:         * For example, given a <code>hello</code> method and the following &lt;netui-data:callPageFlow> tag:
065:         * <pre>
066:         * &lt;netui-data:callPageFlow method="hello" resultId="helloMessage"/>
067:         * </pre>
068:         * <p>
069:         * the result of the call is stored in the <code>${pageScope}</code> JSP EL implicit object under
070:         * the attribute <code>helloMessage</code>.  It will be accessible via <code>${pageScope.helloMessage}</code> and
071:         * can be used as:
072:         * <pre>
073:         *     &lt;netui:span value="<b>${pageScope.helloMessage}</b>"/>
074:         * </pre>
075:         * </p>
076:         * <p>
077:         * In JSP scriptlet, the result can be retrieved by calling the <code>getAttribute()</code> method on the
078:         * {@link javax.servlet.jsp.PageContext javax.servlet.jsp.PageContext} object:
079:         * <pre>
080:         *     &lt;%= pageContext.getAttribute("helloMessage") %>
081:         * </pre>
082:         * </p>
083:         * @example
084:         * In the following sample, the &lt;netui-data:callPageFlow> tag calls the
085:         * sumCartItems method on the Controller file.  The {@link org.apache.beehive.netui.tags.html.Span} tag
086:         * accesses the result through the ${pageScope} data binding context.
087:         * <pre>
088:         *      &lt;netui-data:callPageFlow method="sumCartItems" resultId="cartSum">
089:         *          &lt;netui-data:methodParameter value="${pageFlow.cart.lineItemList}"/>
090:         *      &lt;/netui-data:callPageFlow>
091:         *      ...
092:         *      &lt;netui:span value="${pageScope.cartSum}"/>
093:         * </pre>
094:         * @netui:tag name="callPageFlow" deprecated="true"
095:         *            description="Use this tag to call a method on the current page flow controller."
096:         */
097:        public class CallPageFlow extends CallMethod {
098:
099:            private static final Logger LOGGER = Logger
100:                    .getInstance(CallPageFlow.class);
101:            private static final String DEFAULT_OBJECT_NAME = Bundle
102:                    .getString("Tags_CallPageFlow_defaultObjectName");
103:
104:            /**
105:             * Get the name of this tag.  This is used to identify the type of this tag
106:             * for reporting tag errors.
107:             *
108:             * @return a constant String representing the name of this tag.
109:             */
110:            public String getTagName() {
111:                return "CallPageFlow";
112:            }
113:
114:            /**
115:             * Get the name of the object that is the target of the invocation.
116:             *
117:             * @return a name for the object on which the method will be invoked.
118:             */
119:            protected String getObjectName() {
120:                return DEFAULT_OBJECT_NAME;
121:            }
122:
123:            /**
124:             * Get the PageFlow for the using JSP's directory.  This is an implementation of the
125:             * {@link CallMethod#resolveObject()} method that finds the current PageFlow
126:             * using the {@link PageFlowUtils#getCurrentPageFlow} method.
127:             *
128:             * @return the current PageFlow.  If there is no current PageFlow, the {@link ObjectNotFoundException} will
129:             *         be thrown.
130:             * @throws ObjectNotFoundException when an exception occurs ensuring that a Page Flow is created.
131:             */
132:            protected Object resolveObject() throws ObjectNotFoundException {
133:                try {
134:                    /* todo: because of a javac bug (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090006), we
135:                            can't call PageFlowUtils.getCurrentPageFlow here; thus, the call to getCurrentActionResolver.
136:                     */
137:                    Object jpf = PageFlowUtils.getCurrentPageFlow(
138:                            (HttpServletRequest) pageContext.getRequest(),
139:                            pageContext.getServletContext());
140:
141:                    if (LOGGER.isDebugEnabled())
142:                        LOGGER.debug("Found a pageflow of type: "
143:                                + (jpf != null ? jpf.getClass().getName()
144:                                        : "null"));
145:
146:                    return jpf;
147:                } catch (Exception e) {
148:                    throw new ObjectNotFoundException(Bundle
149:                            .getErrorString("Tags_CallPageFlow_noPageFlow"), e);
150:                }
151:            }
152:        }
w_w_w___.__j_a___v_a__2_s___._c___om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.