Source Code Cross Referenced for GenericUIBean.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » components » 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 » J2EE » webwork 2.2.6 » com.opensymphony.webwork.components 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.opensymphony.webwork.components;
002:
003:        import com.opensymphony.xwork.util.OgnlValueStack;
004:        import com.opensymphony.webwork.util.ContainUtil;
005:
006:        import javax.servlet.http.HttpServletRequest;
007:        import javax.servlet.http.HttpServletResponse;
008:
009:        /**
010:         * <!-- START SNIPPET: javadoc -->
011:         * 
012:         * Renders an custom UI widget using the specified templates. Additional objects can be passed in to the template
013:         * using the param tags.<p/>
014:         * 
015:         * <b>Freemarker:</b><p/>
016:         * Objects provided can be retrieve from within the template via $parameters._paramname_.<p/>
017:         * 
018:         * <b>Jsp:</b><p/>
019:         * Objects provided can be retrieve from within the template via &lt;ww:property value="%{parameters._paramname_}" /&gt;<p/>
020:         *
021:         *
022:         * In the bottom JSP and Velocity samples, two parameters are being passed in to the component. From within the
023:         * component, they can be accessed as:- <p/>
024:         * 
025:         * <b>Freemarker:</b><p/>
026:         * $parameters.get('key1') and $parameters.get('key2') or $parameters.key1 and $parameters.key2<p/>
027:         * 
028:         * <b>Jsp:</b><p/>
029:         * &lt;ww:property value="%{parameters.key1}" /&gt; and &lt;ww:property value="%{'parameters.key2'}" /&gt; or
030:         * &lt;ww:property value="%{parameters.get('key1')}" /&gt; and &lt;ww:property value="%{parameters.get('key2')}" /&gt;<p/>
031:         *
032:         * Currently, your custom UI components can be written in Velocity, JSP, or Freemarker, and the correct rendering
033:         * engine will be found based on file extension.<p/>
034:         *
035:         * <b>Remember:</b> the value params will always be resolved against the OgnlValueStack so if you mean to pass a
036:         * string literal to your component, make sure to wrap it in quotes i.e. value="'value1'" otherwise, the the value
037:         * stack will search for an Object on the stack with a method of getValue1(). (now that i've written this, i'm not
038:         * entirely sure this is the case. i should verify this manana)<p/>
039:         * 
040:         * <!-- END SNIPPET: javadoc -->
041:         *
042:         * <p/> <b>Examples</b>
043:         *
044:         * <pre>
045:         * <!-- START SNIPPET: example -->
046:         * JSP
047:         *     &lt;ww:component template="/my/custom/component.vm"/&gt;
048:         *     
049:         *       or
050:         *
051:         *     &lt;ww:component template="/my/custom/component.vm"&gt;
052:         *       &lt;ww:param name="key1" value="value1"/&gt;
053:         *       &lt;ww:param name="key2" value="value2"/&gt;
054:         *     &lt;/ww:component&gt;
055:         *
056:         * Velocity
057:         *     #wwcomponent( "template=/my/custom/component.vm" )
058:         *
059:         *       or
060:         *
061:         *     #wwcomponent( "template=/my/custom/component.vm" )
062:         *       #wwparam( "name=key1" "value=value1" )
063:         *       #wwparam( "name=key2" "value=value2" )
064:         *     #end
065:         *     
066:         * Freemarker
067:         *    &lt;@ww.component template="/my/custom/component.ftl" />
068:         *    
069:         *      or
070:         *      
071:         *    &lt;@ww.component template="/my/custom/component.ftl"&gt;
072:         *       &lt;@ww.param name="key1" value="%{'value1'}" /&gt;
073:         *       &lt;@ww.param name="key2" value="%{'value2'}" /&gt;
074:         *    &lt;/@ww.component&gt;
075:         *    
076:         * <!-- END SNIPPET: example -->
077:         * </pre>
078:         * 
079:         * <p/>
080:         * 
081:         * <b>NOTE:</b>
082:         * <!-- START SNIPPET: note -->
083:         * 
084:         * If Jsp is used as the template, the jsp template itself must lie within the 
085:         * webapp itself and not the classpath. Unlike Freemarker or Velocity, JSP template
086:         * could not be picked up from the classpath.
087:         * 
088:         * <!-- END SNIPPET: note -->
089:         * 
090:         *
091:         * @author Patrick Lightbody
092:         * @author Rene Gielen
093:         * @author tm_jee
094:         * @version $Date: 2006-06-16 09:55:54 +0200 (Fri, 16 Jun 2006) $ $Revision: 2608 $ 
095:         * @since 2.2
096:         *
097:         * @ww.tag name="component" tld-body-content="JSP" tld-tag-class="com.opensymphony.webwork.views.jsp.ui.ComponentTag"
098:         * description="Render a custom ui widget"
099:         */
100:        public class GenericUIBean extends UIBean {
101:            private final static String TEMPLATE = "empty";
102:
103:            public GenericUIBean(OgnlValueStack stack,
104:                    HttpServletRequest request, HttpServletResponse response) {
105:                super (stack, request, response);
106:            }
107:
108:            public boolean contains(Object obj1, Object obj2) {
109:                return ContainUtil.contains(obj1, obj2);
110:            }
111:
112:            protected String getDefaultTemplate() {
113:                return TEMPLATE;
114:            }
115:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.