Java Doc for CheckLogin.java in  » J2EE » Expresso » com » jcorporate » expresso » core » servlet » 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 » Expresso » com.jcorporate.expresso.core.servlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jcorporate.expresso.core.servlet.CheckLogin

CheckLogin
final public class CheckLogin (Code)
CheckLogin accepts an HttpServletRequest and HttpServletResponse object pair, and attempts to check if the user is logged in. If not, CheckLogin tries to log the user in via a cookie from the client. If this is not possible, the user is logged in as "NONE".

It has now been modified to be a Singleton Object rather than having a new object allocated with each request.

Example Usage:
CheckLogin.getInstance().checkLogin(request,response);

author:
   Michael Nash, Singleton Modification by Michael Rimov



Field Summary
static  CheckLogintheInstance
    

Constructor Summary
protected  CheckLogin()
     Default Constructor....

Method Summary
public  voidcheckLogin(HttpServletRequest request, HttpServletResponse response, ServletConfig c, String forceDB)
    
public  voidcheckLogin(HttpServletRequest request, String forceDB)
    
public  voidcheckLogin(HttpServletRequest request)
    
public  voidcheckLogin(HttpServletRequest request, HttpServletResponse response, ServletConfig c)
    
public  voidcheckLogin(HttpServletRequest request, HttpServletResponse response)
    
public static  CheckLogingetInstance()
    
public  voidlogInAsNone(HttpServletRequest request, String forceDB)
    
public  booleanloginViaContainer(HttpServletRequest request, String forceDB)
     Try to log in with a user name obtained from the container.
public  booleanloginViaCookie(HttpServletRequest request, String forceDB)
     Try to log in via the cookie from the client - if successful, return true.

Field Detail
theInstance
static CheckLogin theInstance(Code)




Constructor Detail
CheckLogin
protected CheckLogin()(Code)
Default Constructor.... Simply sets up the Log It should not be called anymore directly. Use getInstance() instead.




Method Detail
checkLogin
public void checkLogin(HttpServletRequest request, HttpServletResponse response, ServletConfig c, String forceDB) throws ServletException, NonHandleableException(Code)
see if login is legitimate
Parameters:
  request - Standard request object
Parameters:
  response - Standard response object
Parameters:
  c - ServletConfig object of the calling servlet
Parameters:
  forceDB - the db to force a login to
throws:
  ServletException - If an uncaught exception occurs
throws:
  NonHandleableException - upon fatal error



checkLogin
public void checkLogin(HttpServletRequest request, String forceDB) throws ServletException, NonHandleableException(Code)
see if login is legitimate
Parameters:
  request - Standard request object
Parameters:
  forceDB - the db to force a login to
throws:
  ServletException - If an uncaught exception occurs
throws:
  NonHandleableException - upon fatal error



checkLogin
public void checkLogin(HttpServletRequest request) throws ServletException, NonHandleableException(Code)
see if login is legitimate
Parameters:
  request - Standard request object
throws:
  ServletException - If an uncaught exception occurs
throws:
  NonHandleableException - upon fatal error



checkLogin
public void checkLogin(HttpServletRequest request, HttpServletResponse response, ServletConfig c) throws ServletException, NonHandleableException(Code)
see if login is legitimate
Parameters:
  request - Standard request object
Parameters:
  response - Standard response object
Parameters:
  c - ServletConfig object of the calling servlet
throws:
  ServletException - If an uncaught exception occurs
throws:
  NonHandleableException - upon fatal error



checkLogin
public void checkLogin(HttpServletRequest request, HttpServletResponse response) throws NonHandleableException(Code)
see if login is legitimate
Parameters:
  request - Standard request object
Parameters:
  response - Standard response object
throws:
  NonHandleableException - upon fatal error



getInstance
public static CheckLogin getInstance()(Code)



logInAsNone
public void logInAsNone(HttpServletRequest request, String forceDB) throws ServletException(Code)
For some reason a login session could not be established, so log the user in as the "unknown" user "NONE"
Parameters:
  request - the servlet request object
Parameters:
  forceDB - the data context to log into



loginViaContainer
public boolean loginViaContainer(HttpServletRequest request, String forceDB) throws Exception(Code)
Try to log in with a user name obtained from the container. This function assumes that the container has already authenticated the user's ID and password, thus no password checking is performed.

This is intended to allow more fine-grained access control via Expresso's built-in mechanisms.

If successful, return true. If not, return false.
Parameters:
  request - The request object
Parameters:
  forceDB - Name of default database to set true if successfull
throws:
  Exception - upon error




loginViaCookie
public boolean loginViaCookie(HttpServletRequest request, String forceDB) throws Exception(Code)
Try to log in via the cookie from the client - if successful, return true. If not, return false
Parameters:
  request - the servlet request object
Parameters:
  forceDB - the data context to login to true if successfull
throws:
  Exception - upon error



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.