Source Code Cross Referenced for PageUnauthorizedException.java in  » J2EE » Enhydra-Application-Framework » com » lutris » appserver » server » httpPresentation » 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 Application Framework » com.lutris.appserver.server.httpPresentation 
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: PageUnauthorizedException.java,v 1.2 2006-06-15 13:40:47 sinisa Exp $
022:         */
023:
024:        package com.lutris.appserver.server.httpPresentation;
025:
026:        /**
027:         * Throwing this class will cause a 401 Unauthorized response. 
028:         *
029:         * @see com.lutris.http.BasicAuth
030:         * @author Andy John
031:         */
032:        public class PageUnauthorizedException extends RuntimeException {
033:            /**
034:             * The relm to ask for. This string is used by the browser in the
035:             * prompt for username and password. It should identify to the 
036:             * user which system they are logging in to, i.e. which username
037:             * and password to use.
038:             */
039:            private String relm;
040:
041:            /**
042:             * Default title.
043:             */
044:            private static final String defaultHtmlTitle = "Unauthorized access";
045:
046:            /**
047:             * Default text message to display.
048:             */
049:            private static final String defaultHtmlText = "<B>Client is not authorized to access this page</B>";
050:
051:            /**
052:             * HTML title to display. (not yet configurable).
053:             */
054:            private String htmlTitle = defaultHtmlTitle;
055:
056:            /**
057:             * HTML Text message to display.
058:             */
059:            private String htmlText = defaultHtmlText;
060:
061:            /**
062:             * Create a new unauthorized exception.
063:             *
064:             * @param relm The relm to ask for. This string is used by the browser
065:             * in the prompt for username and password. It should identify to the 
066:             * user which system they are logging in to, i.e. which username   
067:             * and password to use. For example, if relm is XXX, then Netscape
068:             * Navigator will prompt the user with "Enter the username for
069:             * XXX at <host>:<port>".
070:             */
071:            public PageUnauthorizedException(String requestedRelm) {
072:                super (defaultHtmlTitle);
073:                relm = requestedRelm;
074:            }
075:
076:            /**
077:             * Create a new unauthorized exception.
078:             *
079:             * @param relm The relm to ask for. This string is used by the browser
080:             * in the prompt for username and password. It should identify to the 
081:             * user which system they are logging in to, i.e. which username   
082:             * and password to use. For example, if relm is XXX, then Netscape
083:             * Navigator will prompt the user with "Enter the username for
084:             * XXX at <host>:<port>".
085:             * @param htmlDisplayText Text to display on the page.  If null,
086:             *  a default will be used.
087:             */
088:            public PageUnauthorizedException(String requestedRelm,
089:                    String htmlDisplayText) {
090:                super (defaultHtmlTitle);
091:                relm = requestedRelm;
092:                if (htmlDisplayText != null) {
093:                    htmlText = htmlDisplayText;
094:                }
095:            }
096:
097:            /**
098:             * Get the relm that was passed in to the constructor.
099:             * This is used as part of the prompt to the user by the browser.
100:             *
101:             * @return The relm string. 
102:             */
103:            public String getRelm() {
104:                return relm;
105:            }
106:
107:            /**
108:             * Get the title to use for the HTML page.
109:             *
110:             * @return The title string.
111:             */
112:            public String getHtmlTitle() {
113:                return htmlTitle;
114:            }
115:
116:            /**
117:             * Get the text to display in the client.
118:             *
119:             * @return The HTML text.
120:             */
121:            public String getHtmlText() {
122:                return htmlText;
123:            }
124:
125:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.