Source Code Cross Referenced for IncludeTag.java in  » Portal » gridsphere » org » gridsphere » provider » portletui » tags » 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 » gridsphere » org.gridsphere.provider.portletui.tags 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package org.gridsphere.provider.portletui.tags;
02:
03:        import org.apache.commons.logging.Log;
04:        import org.apache.commons.logging.LogFactory;
05:        import org.gridsphere.portlet.impl.StoredPortletResponseImpl;
06:        import org.gridsphere.provider.portletui.beans.IncludeBean;
07:
08:        import javax.servlet.RequestDispatcher;
09:        import javax.servlet.ServletContext;
10:        import javax.servlet.ServletRequest;
11:        import javax.servlet.ServletResponse;
12:        import javax.servlet.http.HttpServletRequest;
13:        import javax.servlet.http.HttpServletResponse;
14:        import javax.servlet.jsp.JspException;
15:
16:        /*
17:         * @author <a href="mailto:russell@aei.mpg.de">Michael Russell</a>
18:         * @version $Id: IncludeTag.java 6407 2008-01-16 15:20:21Z wehrens $
19:         * <p>
20:         * Includes jsp pages from any web application.
21:         */
22:
23:        public class IncludeTag extends BaseBeanTag {
24:
25:            private Log log = LogFactory.getLog(IncludeTag.class);
26:            protected IncludeBean includeBean = null;
27:            protected ServletContext servletContext = null;
28:            protected String page = null;
29:
30:            public ServletContext getServletContext() {
31:                return servletContext;
32:            }
33:
34:            public void setServletContext(ServletContext servletContext) {
35:                this .servletContext = servletContext;
36:            }
37:
38:            public String getPage() {
39:                return page;
40:            }
41:
42:            public void setPage(String page) {
43:                this .page = page;
44:            }
45:
46:            public int doStartTag() throws JspException {
47:                if (beanId.equals("")) {
48:                    // If no bean id, create new bean
49:                    includeBean = new IncludeBean();
50:                    if (servletContext == null) {
51:                        // If no servlet context provided, then provide this context
52:                        servletContext = pageContext.getServletContext();
53:                    }
54:                } else {
55:                    // Else get bean with bean id
56:                    includeBean = (IncludeBean) getTagBean();
57:                    if (includeBean == null) {
58:                        // If no bean with given id, exit early
59:                        return SKIP_BODY;
60:                    }
61:                    if (includeBean.getServletContext() == null) {
62:                        // If no servlet context provided, then provide this context
63:                        servletContext = pageContext.getServletContext();
64:                    } else {
65:                        log.debug("Using include bean context");
66:                        servletContext = includeBean.getServletContext();
67:                    }
68:                    page = includeBean.getPage();
69:                }
70:                // Set portlet request and response attributes
71:                //includeBean.setJspWriter(pageContext.getOut());
72:
73:                includePage();
74:                return SKIP_BODY;
75:            }
76:
77:            protected void includePage() {
78:                RequestDispatcher rd = servletContext
79:                        .getRequestDispatcher(page);
80:                try {
81:                    ServletRequest request = pageContext.getRequest();
82:                    ServletResponse response = pageContext.getResponse();
83:                    // Very important here... must pass it the appropriate jsp writer!!!
84:                    // Or else this include won't be contained within the parent content
85:                    // but either before or after it.
86:                    //rd.include(request, new ServletResponseWrapperInclude(response, pageContext.getOut()));
87:                    rd.include(request, new StoredPortletResponseImpl(
88:                            (HttpServletRequest) request,
89:                            (HttpServletResponse) response, pageContext
90:                                    .getOut()));
91:                    //rd.include(pageContext.getRequest(), pageContext.getResponse());
92:                } catch (Exception e) {
93:                    log.error("Unable to include page ", e);
94:                }
95:            }
96:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.