Source Code Cross Referenced for FormTag.java in  » Content-Management-System » TransferCM » com » methodhead » transfer » 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 » Content Management System » TransferCM » com.methodhead.transfer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Copyright (C) 2006 Methodhead Software LLC.  All rights reserved.
003:         * 
004:         * This file is part of TransferCM.
005:         * 
006:         * TransferCM is free software; you can redistribute it and/or modify it under the
007:         * terms of the GNU General Public License as published by the Free Software
008:         * Foundation; either version 2 of the License, or (at your option) any later
009:         * version.
010:         * 
011:         * TransferCM is distributed in the hope that it will be useful, but WITHOUT ANY
012:         * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
013:         * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
014:         * details.
015:         * 
016:         * You should have received a copy of the GNU General Public License along with
017:         * TransferCM; if not, write to the Free Software Foundation, Inc., 51 Franklin St,
018:         * Fifth Floor, Boston, MA  02110-1301  USA
019:         */
020:
021:        package com.methodhead.transfer;
022:
023:        import java.io.IOException;
024:
025:        import javax.servlet.http.HttpServletRequest;
026:        import javax.servlet.http.HttpServletResponse;
027:        import javax.servlet.http.HttpSession;
028:        import javax.servlet.jsp.JspException;
029:        import javax.servlet.jsp.JspWriter;
030:        import javax.servlet.jsp.PageContext;
031:        import javax.servlet.jsp.tagext.TagSupport;
032:
033:        import org.apache.struts.Globals;
034:        import org.apache.struts.action.ActionForm;
035:        import org.apache.struts.action.ActionMapping;
036:        import org.apache.struts.action.ActionServlet;
037:        import org.apache.struts.config.FormBeanConfig;
038:        import org.apache.struts.config.ModuleConfig;
039:        import org.apache.struts.util.MessageResources;
040:        import org.apache.struts.util.RequestUtils;
041:        import org.apache.struts.util.ResponseUtils;
042:
043:        /**
044:         * Extends Struts' <code>FormTag</code> to add module attribute, which is used
045:         * to lookup the correct <code>ModuleConfig</code>.  This situation arises when
046:         * extensions, implemented in Struts modules, forward to a shim page (.shtml)
047:         * to display their form.  Since pages are displayed by PageAction, part of the
048:         * root Struts module, the form tag must explicitly be told which module to
049:         * look for action mappings in.
050:         */
051:        public class FormTag extends org.apache.struts.taglib.html.FormTag {
052:
053:            // constructors /////////////////////////////////////////////////////////////
054:
055:            // constants ////////////////////////////////////////////////////////////////
056:
057:            // classes //////////////////////////////////////////////////////////////////
058:
059:            // methods //////////////////////////////////////////////////////////////////
060:
061:            /**
062:             * Overrides default behaviour to render a relative URL for the action.
063:             * This is combined with the base tag inserted by the Shim head tag to make
064:             * the proper request.
065:             */
066:            protected String renderFormStartElement() {
067:                HttpServletResponse response = (HttpServletResponse) this .pageContext
068:                        .getResponse();
069:
070:                StringBuffer results = new StringBuffer("<form");
071:                results.append(" name=\"");
072:                results.append(beanName);
073:                results.append("\"");
074:                results.append(" method=\"");
075:                results.append(method == null ? "post" : method);
076:                results.append("\" action=\"");
077:
078:                //
079:                // BEGIN shim hack
080:                //
081:
082:                //
083:                // insert the module prefix and print the result as a relative url
084:                //
085:                ModuleConfig config = (ModuleConfig) pageContext.getRequest()
086:                        .getAttribute(Globals.MODULE_KEY);
087:
088:                if (config != null) {
089:                    results.append(config.getPrefix().substring(1) + "/");
090:                }
091:
092:                results.append(response.encodeURL(this .action.substring(1)
093:                        + ".do"));
094:
095:                //
096:                // END shim hack
097:                //
098:
099:                results.append("\"");
100:
101:                if (styleClass != null) {
102:                    results.append(" class=\"");
103:                    results.append(styleClass);
104:                    results.append("\"");
105:                }
106:                if (enctype != null) {
107:                    results.append(" enctype=\"");
108:                    results.append(enctype);
109:                    results.append("\"");
110:                }
111:                if (onreset != null) {
112:                    results.append(" onreset=\"");
113:                    results.append(onreset);
114:                    results.append("\"");
115:                }
116:                if (onsubmit != null) {
117:                    results.append(" onsubmit=\"");
118:                    results.append(onsubmit);
119:                    results.append("\"");
120:                }
121:                if (style != null) {
122:                    results.append(" style=\"");
123:                    results.append(style);
124:                    results.append("\"");
125:                }
126:                if (styleId != null) {
127:                    results.append(" id=\"");
128:                    results.append(styleId);
129:                    results.append("\"");
130:                }
131:                if (target != null) {
132:                    results.append(" target=\"");
133:                    results.append(target);
134:                    results.append("\"");
135:                }
136:                results.append(">");
137:                return results.toString();
138:            }
139:
140:            // properties ///////////////////////////////////////////////////////////////
141:
142:            // attributes ///////////////////////////////////////////////////////////////
143:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.