Source Code Cross Referenced for CatalogTag.java in  » Portal » Open-Portal » com » sun » portal » wireless » taglibs » util » 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 » Portal » Open Portal » com.sun.portal.wireless.taglibs.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: CatalogTag.java,v 1.5 2005/09/21 10:53:11 dg154973 Exp $
003:         * Copyright 2002 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.wireless.taglibs.util;
014:
015:        import java.util.Locale;
016:        import java.util.logging.Logger;
017:
018:        import javax.servlet.jsp.*;
019:        import javax.servlet.jsp.tagext.*;
020:
021:        import com.sun.portal.log.common.PortalLogger;
022:        import com.sun.portal.wireless.taglibs.base.*;
023:
024:        /**
025:         * CatalogTag - make a message catalog available
026:         *
027:         * Attributes:
028:         *
029:         * id - name to save catalog on page context
030:         * name - name to retrieve catalog from page context
031:         * resource - name of resource to load
032:         *
033:         * @author Bryan Hanks
034:         * @author Robert O'Brien
035:         *
036:         * @version 1.0
037:         */
038:        public class CatalogTag extends BaseTagSupport implements  BeanHolder {
039:
040:            private static Logger logger = PortalLogger
041:                    .getLogger(CatalogTag.class);
042:            /**
043:             * The message catalog
044:             */
045:            Catalog catalog;
046:
047:            /**
048:             * Name of the resource bundle
049:             */
050:            String resource;
051:
052:            /**
053:             * Return the message catalog
054:             * 
055:             * @return the message catalog
056:             */
057:            public Catalog getCatalog() {
058:                return catalog;
059:            }
060:
061:            /**
062:             * Return the catalog as a bean
063:             * 
064:             * @return the message catalog
065:             */
066:            public Object getBean() {
067:                return catalog;
068:            }
069:
070:            /**
071:             * Make the message catalog available
072:             * 
073:             * @return EVAL_BODY_INCLUDE
074:             * @exception JspException
075:             */
076:            public int doStartTag() throws JspException {
077:
078:                if (name != null) {
079:                    catalog = (Catalog) pageContext.findAttribute(name);
080:                    if (catalog != null) {
081:                        return EVAL_BODY_INCLUDE;
082:                    }
083:                }
084:
085:                if (resource == null) {
086:                    logger.warning("PSMA_CSPWTU0006");
087:                    throw new JspException(
088:                            "CatalogTag: missing 'resource' attribute");
089:                }
090:
091:                catalog = new Catalog(resource, getLocale());
092:
093:                if (id != null) {
094:                    pageContext.setAttribute(id, catalog);
095:                }
096:
097:                return EVAL_BODY_INCLUDE;
098:            }
099:
100:            /**
101:             * Get the user's locale
102:             * 
103:             * @return 
104:             */
105:            private Locale getLocale() {
106:                try {
107:                    UtilContext uc = UtilContext.getContext(pageContext);
108:                    return uc.getLocale();
109:                } catch (Exception e) {
110:                    return Locale.getDefault();
111:                }
112:            }
113:
114:            /**
115:             * Set the resource attribute
116:             * 
117:             * @param resource the resource
118:             */
119:            public void setResource(String resource) {
120:                this .resource = resource;
121:            }
122:
123:            /**
124:             * Cleanup
125:             */
126:            public void release() {
127:                super.release();
128:                resource = null;
129:                catalog = null;
130:            }
131:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.