Source Code Cross Referenced for Login.java in  » J2EE » Enhydra-Demos » jtaDiscRack » presentation » personMgmt » 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 » Enhydra Demos » jtaDiscRack.presentation.personMgmt 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         *
021:         * $Id: Login.java,v 1.1 2006-09-11 12:40:05 sinisa Exp $
022:         */
023:
024:        package jtaDiscRack.presentation.personMgmt;
025:
026:        import jtaDiscRack.spec.*;
027:        import jtaDiscRack.presentation.BasePO;
028:        import jtaDiscRack.presentation.JtaDiscRackPresentationException;
029:
030:        import com.lutris.appserver.server.httpPresentation.*;
031:        import org.enhydra.xml.xmlc.XMLObject;
032:
033:        /**
034:         * Login.java handles the login functionality of the DiscRack app.
035:         * 
036:         */
037:        public class Login extends BasePO {
038:
039:            /**
040:             * Constants
041:             */
042:            private static String LOGIN_NAME = "login";
043:
044:            private static String PASSWORD_NAME = "password";
045:
046:            /**
047:             * Superclass method override
048:             */
049:            public boolean loggedInUserRequired() {
050:                return false;
051:            }
052:
053:            /**
054:             * Default event. Just show the page.
055:             */
056:            public XMLObject handleDefault() throws HttpPresentationException {
057:                return showPage(null);
058:            }
059:
060:            /**
061:             * Process login data
062:             * 
063:             * @return wml document
064:             * @exception HttpPresentationException
065:             */
066:            public XMLObject handleLogin() throws HttpPresentationException {
067:                String login = this .getComms().request.getParameter(LOGIN_NAME);
068:                String password = this .getComms().request
069:                        .getParameter(PASSWORD_NAME);
070:
071:                /*
072:                 * Catch Null pointer exception ( we canot make a instances of classes
073:                 * from business layer when we run discRack_pres ) We need to allow
074:                 * presentation module to be functional , to allow users who run
075:                 * discRack_pres response will be default HTML page
076:                 */
077:                try {
078:
079:                    Person user = ((PersonGenerator) PersonGeneratorFactory
080:                            .getPersonGenerator("jtaDiscRack.business.person.PersonGeneratorImpl"))
081:                            .findPerson(login);
082:                    if (null == user || !user.getPassword().equals(password)) {
083:                        return showPage("Invalid username or password");
084:                        // Show error message that user not found (bad
085:                        // username/password)
086:                    } else {
087:                        this .setUser(user);
088:                        throw new ClientPageRedirectException(
089:                                getComms().request.getApplicationPath()
090:                                        + DISC_CATALOG_PAGE);
091:                    }
092:                } catch (JtaDiscRackException ex) {
093:                    writeDebugMsg("System error finding user: "
094:                            + ex.getMessage());
095:                    throw new JtaDiscRackPresentationException(
096:                            "System error finding user", ex);
097:                } catch (Exception ex) {
098:                    // securte presentation mode response
099:                    throw new ClientPageRedirectException(getComms().request
100:                            .getApplicationPath()
101:                            + DISC_CATALOG_PAGE);
102:                }
103:            }
104:
105:            /**
106:             * handle logout event
107:             * 
108:             * @return html document
109:             * @exception HttpPresentationException
110:             */
111:            public XMLObject handleLogout() throws HttpPresentationException {
112:                this .removeUserFromSession();
113:                return (ExitHTML) myComms.xmlcFactory.create(ExitHTML.class);
114:            }
115:
116:            /**
117:             * handle throw exception event.
118:             * 
119:             * @return html document
120:             * @exception Exception
121:             */
122:            public XMLObject handleThrowException() throws Exception {
123:                throw new Exception(
124:                        "This is a test exception thrown from Login.java handleThrowException()");
125:            }
126:
127:            /**
128:             * display page
129:             * 
130:             * @param errorMsg
131:             *            the error messages
132:             * @return html document
133:             */
134:            public XMLObject showPage(String errorMsg) {
135:
136:                LoginHTML page = (LoginHTML) myComms.xmlcFactory
137:                        .create(LoginHTML.class);
138:
139:                if (null != errorMsg
140:                        || null != (errorMsg = this.getSessionData()
141:                                .getAndClearUserMessage())) {
142:                    page.setTextErrorText(errorMsg);
143:                } else {
144:                    page.getElementErrorText().getParentNode().removeChild(
145:                            page.getElementErrorText());
146:                }
147:
148:                return page;
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.