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


001:        /**
002:         * $Id: CommandTag.java,v 1.5 2005/09/21 10:50:33 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.base;
014:
015:        import com.sun.portal.log.common.PortalLogger;
016:
017:        import javax.servlet.jsp.*;
018:        import javax.servlet.jsp.tagext.*;
019:        import java.util.logging.Logger;
020:        import java.util.logging.Level;
021:
022:        /**
023:         * The CommandTag abstract class supports tags which execute
024:         * a command or action. Subclasses must implement the
025:         * abstract execute() method.
026:         * 
027:         * @author Robert O'Brien
028:         * @version 1.0
029:         */
030:        public abstract class CommandTag extends BaseTagSupport {
031:
032:            // Create a logger for this class
033:            private static Logger debugLogger = PortalLogger
034:                    .getLogger(CommandTag.class);
035:
036:            /**
037:             * Saves the status of command execution
038:             */
039:            protected boolean executeStatus = false;
040:
041:            /**
042:             * Execute the command action. Returns the command status.
043:             * Subclasses must provide an implementation of this method.
044:             * If the command fails then the tag body is included,
045:             * Else if the command fails then the tag body is skipped.
046:             * 
047:             * @return true if the command succeeds.
048:             *         false if the command fails.
049:             * @exception JspException
050:             */
051:            public abstract boolean execute() throws JspException;
052:
053:            /**
054:             * Execute the command and include or skip the
055:             * body depending on the command status. If the
056:             * command succeeds then skip the tag body. If 
057:             * the command fails then include the tag body.
058:             * 
059:             * @return SKIP_BODY if the command succeeds.
060:             *         EVAL_BODY_INCLUDE if the command fails.
061:             * @exception JspException
062:             */
063:            public int doStartTag() throws JspException {
064:                try {
065:                    executeStatus = execute();
066:                } catch (Exception e) {
067:                    debugLogger.log(Level.FINE, "PSMA_CSPWTB0006", e);
068:                    throw new JspException(this .getClass().getName()
069:                            + ".doStartTag():  execute failed:  "
070:                            + e.getMessage());
071:                }
072:                if (executeStatus) {
073:                    return SKIP_BODY;
074:                } else {
075:                    return EVAL_BODY_INCLUDE;
076:                }
077:            }
078:
079:            /**
080:             * If command has succeeded then evaluate the rest 
081:             * of the page. If the command fails then skip the 
082:             * page.
083:             * 
084:             * @return SKIP_PAGE if the command fails.
085:             *         EVAL_PAGE if the command suceeds.
086:             * @exception JspException
087:             */
088:            public int doEndTag() throws JspException {
089:                if (executeStatus) {
090:                    return EVAL_PAGE;
091:                } else {
092:                    return SKIP_PAGE;
093:                }
094:            }
095:
096:            /**
097:             * Cleanup
098:             */
099:            public void release() {
100:                super .release();
101:                executeStatus = false;
102:            }
103:
104:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.