Friday, August 6, 2010

The Exception Hirarchy in Java


The rationale behind the hierarchy is as follows:

  • Exception subclasses represent errors that a program can reasonably recover from. Except for RuntimeException and its subclasses (see below), they generally represent errors that a program will expect to occur in the normal course of duty: for example, network connection errors and filing system errors.

  • Error subclasses represent "serious" errors that a program generally shouldn't expect to catch and recover from. These include conditions such as an expected class file being missing, or an OutOfMemoryError.

  • RuntimeException is a further subclass of Exception. RuntimeException and its subclasses are slightly different: they represent exceptions that a program shouldn't generally expect to occur, but could potentially recover from. They represent what are likely to be programming errors rather than errors due to invalid user input or a badly configured environment.

Collections hirarchy


We have tried you to make a walk through the Collection Framework. The Collection Framework provides a well-designed set if interface and classes for sorting and manipulating groups of data as a single unit, a collection.

The Collection Framework provides a standard programming interface to many of the most common abstractions, without burdening the programmer with too many procedures and interfaces.

The Collection Framework is made up of a set of interfaces for working with the groups of objects. The different interfaces describe the different types of groups. For the most part, once you understand the interfaces, you understand the framework. While you always need to create specific, implementations of the interfaces, access to the actual collection should be restricted to the use of the interface methods, thus allowing you to change the underlying data structure, without altering the rest of your code.

Tuesday, August 3, 2010

Java™Servlet Specification Version 2.3 (pdf) Download


Contents

Status ................................................................................................. 12
Changes in this document since v2.2........................................... 12
Preface ............................................................................................... 14
Who should read this document .................................................. 14
API Reference ............................................................................. 14
Other Java™ Platform Specifications.......................................... 14
Other Important References ........................................................ 15
Providing Feedback..................................................................... 16
Acknowledgements ..................................................................... 16
Chapter 1:Overview.......................................................................... 18
What is a Servlet?........................................................................ 18
What is a Servlet Container? ....................................................... 18
An Example................................................................................. 19
Comparing Servlets with Other Technologies ............................. 19
Relationship to Java 2 Platform Enterprise Edition ..................... 20
Chapter 2: The Servlet Interface ...................................................... 22
Request Handling Methods ......................................................... 22
HTTP Specific Request Handling Methods........................ 22
PROPOSED FINAL DRAFT
5 Java Servlet 2.3 Specification - PROPOSED FINAL DRAFT• October 20, 2000
Conditional GET Support ...................................................23
Number of Instances ....................................................................23
Note about SingleThreadModel ..........................................24
Servlet Life Cycle ........................................................................24
Loading and Instantiation ...................................................24
Initialization........................................................................24
Request Handling ...............................................................25
End of Service ....................................................................27
Chapter 3: Servlet Context ................................................................28
Scope of a ServletContext............................................................28
Initialization Parameters ..............................................................28
Context Attributes........................................................................29
Context Attributes in a Distributed Container.....................29
Resources.....................................................................................29
Multiple Hosts and Servlet Contexts............................................30
Reloading Considerations ............................................................30
Temporary Working Directories ..................................................31
Chapter 4: The Request .....................................................................32
Parameters ...................................................................................32
Attributes .....................................................................................33
Headers ........................................................................................33
Request Path Elements.................................................................34
Path Translation Methods ............................................................35
Cookies ........................................................................................36
SSL Attributes .............................................................................36
Internationalization ......................................................................37
Request data encoding .................................................................37
PROPOSED FINAL DRAFT
Contents 6
Chapter 5: The Response .................................................................. 38
Buffering ..................................................................................... 38
Headers........................................................................................ 39
Convenience Methods ................................................................. 40
Internationalization...................................................................... 40
Closure of Response Object ........................................................ 41
Chapter 6: Servlet Filtering .............................................................. 42
What is a filter ? .......................................................................... 42
Examples of Filtering Components .................................... 43
Main Concepts............................................................................. 43
Filter Lifecycle................................................................... 43
Filter environment .............................................................. 45
Configuration of Filters in a Web Application ................... 45
Chapter 7: Sessions ............................................................................ 48
Session Tracking Mechanisms .................................................... 48
URL Rewriting................................................................... 48
Cookies .............................................................................. 49
SSL Sessions...................................................................... 49
Session Integrity................................................................. 49
Creating a Session ....................................................................... 49
Session Scope.............................................................................. 50
Binding Attributes into a Session ................................................ 50
Session Timeouts......................................................................... 50
Last Accessed Times ................................................................... 51
Important Session Semantics....................................................... 51
Threading Issues ................................................................ 51
Distributed Environments................................................... 51
PROPOSED FINAL DRAFT
7 Java Servlet 2.3 Specification - PROPOSED FINAL DRAFT• October 20, 2000
Client Semantics .................................................................52
Chapter 8: Dispatching Requests ......................................................54
Obtaining a RequestDispatcher....................................................54
Query Strings in Request Dispatcher Paths.........................55
Using a Request Dispatcher .........................................................55
Include .........................................................................................56
Included Request Parameters ..............................................56
Forward........................................................................................56
Query String .......................................................................57
Error Handling .............................................................................57
Chapter 9:Web Applications.............................................................58
Relationship to ServletContext ....................................................58
Elements of a Web Application ...................................................58
Distinction Between Representations...........................................59
Directory Structure ......................................................................59
Sample Web Application Directory Structure.....................60
Web Application Archive File .....................................................60
Web Application Configuration Descriptor .................................61
Dependencies on extensions: Library Files.........................61
Web Application Classloader..............................................62
Replacing a Web Application ......................................................62
Error Handling .............................................................................62
Welcome Files .............................................................................63
Web Application Environment ....................................................64
Chapter 10:Application Lifecycle Events ........................................66
Introduction .................................................................................66
Event Listeners ............................................................................66
PROPOSED FINAL DRAFT
Contents 8
Configuration of Listener Classes ............................................... 68
Listener Instances and Threading ................................................ 69
Distributed Containers................................................................. 69
Session Events- Invalidation vs Timeout..................................... 69
Chapter 11: Mapping Requests to Servlets ...................................... 70
Use of URL Paths........................................................................ 70
Specification of Mappings........................................................... 71
Implicit Mappings .............................................................. 71
Example Mapping Set ........................................................ 71
Chapter 12: Security.......................................................................... 74
Introduction ................................................................................. 74
Declarative Security .................................................................... 75
Programmatic Security ................................................................ 75
Roles ........................................................................................... 76
Authentication ............................................................................. 76
HTTP Basic Authentication ............................................... 76
HTTP Digest Authentication.............................................. 77
Form Based Authentication................................................ 77
HTTPS Client Authentication ............................................ 78
Server Tracking of Authentication Information .......................... 79
Propogation of Security Identity.................................................. 79
Specifying Security Constraints .................................................. 80
Default Policies .................................................................. 80
Chapter 13: Deployment Descriptor................................................. 82
Deployment Descriptor Elements................................................ 82
Deployment Descriptor DOCTYPE ................................... 82
DTD ............................................................................................ 83
PROPOSED FINAL DRAFT
9 Java Servlet 2.3 Specification - PROPOSED FINAL DRAFT• October 20, 2000
Examples .....................................................................................96
A Basic Example ................................................................97
An Example of Security......................................................98
Chapter 14: API Details .....................................................................100
Config.................................................................................... 104
Filter ...................................................................................... 106
FilterConfig ........................................................................... 108
GenericServlet....................................................................... 110
RequestDispatcher ................................................................ 115
Servlet ................................................................................... 117
ServletConfig ........................................................................ 120
ServletContext....................................................................... 121
ServletContextAttributeEvent ............................................... 129
ServletContextAttributesListener.......................................... 131
ServletContextEvent ............................................................. 133
ServletContextListener.......................................................... 135
ServletException ................................................................... 136
ServletInputStream................................................................ 139
ServletOutputStream............................................................. 141
ServletRequest ...................................................................... 146
ServletRequestWrapper ........................................................ 153
ServletResponse .................................................................... 159
ServletResponseWrapper ...................................................... 163
SingleThreadModel............................................................... 167
UnavailableException ........................................................... 168
Cookie ................................................................................... 173
HttpServlet ............................................................................ 179
PROPOSED FINAL DRAFT
Contents 10
HttpServletRequest ............................................................... 185
HttpServletRequestWrapper ................................................. 193
HttpServletResponse............................................................. 200
HttpServletResponseWrapper............................................... 212
HttpSession ........................................................................... 217
HttpSessionAttributesListener .............................................. 222
HttpSessionBindingEvent ..................................................... 224
HttpSessionBindingListener ................................................. 227
HttpSessionContext............................................................... 228
HttpSessionEvent .................................................................. 229
HttpSessionListener .............................................................. 231
HttpUtils................................................................................ 232
Appendix A: Deployment Descriptor Version 2.2............................ 236
Appendix B: Glossary........................................................................ 250

Jakarta Struts A beginner's tutorial


Jakarta Struts A beginner's tutorial

Contents
1 Introduction 3
1.1 A brief overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 The MVC design pattern and its application to Struts . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Who should read this tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Installation 4
2.1 JDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Win32 installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Linux installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Tomcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.1 Win32 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3.2 Linux Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3.3 Con guration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.5 Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Learning by example: your rst Struts application 6
3.1 Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Creating the application workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 The rst page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.1 First draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.2 A bit of internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 Enter the application and create the data source . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4.1 The JSP form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4.2 The struts-con g.xml le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4.3 Create the ActionForm and Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4.4 Re ning the login process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.5 Creating a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 The main menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.6 Adding a user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.7 Get information about a user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Conclusion 23


TypingMaster 2010 Free Download




Learn to touch type and you can! TypingMaster Pro for Windows is a personal typing tutor with 5 typing courses, typing tests, dynamic reviews, games and our unique Satellite to track your real-world typing. TypingMaster Pro's optimal learning features adjust training to your personal progress at every stage. Weak spots are pinpointed and rapidly eliminated with additional exercises.

Thanks to this personal approach you can put your new skills into action after only 3 to 5 hours of training. With TypingMaster, you will learn to type fast without typos and save dozens of valuable working hours every year. Better typing will help you get things done!

Saturday, July 31, 2010

Web Based Software Testing .pdf download


Challenges in Testing Web Based Applications


Challenges in Testing Web Based Applications

In this tutorial you will learn about Challenges in Testing Web Based Applications Introduction, Why testing Web Applications is different? Factors effecting Testing of Web Applications, Why technology platforms affect testing? Challenges in Testing Web Based Web Applications, Summary.

Introduction:

Web based Applications are increasingly becoming more feature rich, important and also the most popular means for developing commercial systems. Most companies opt for developing web based software wherever possible. This helps in catering to large number of end users. The deployment of the apps (once the infrastructure is in place) is fairly easy.

The web based applications are powerful and have the ability to provide feature rich content to a wide audience spread across the globe at an economical cost.

Hence it is a daunting task to test these applications and with more and more features testing these apps is becoming even more complex.
In this article we will study the challenges faced when testing these applications



DOWNLOAD

Monday, July 26, 2010

Britney Spears Shopping on Conservatorship Hearing Day

Another conservatorship hearing was held today, and Britney Spears was seen shopping again.

Wait is this coincidence? We don’t see Britney leaving her Calabasas estates for weeks in a row, but everytime her father goes to court for a conservator ship, the singer magically appears everywhere.

This seems a bit odd, but maybe Jamie only allows her to shop on the “hard days”? Anyways, check out this exclusive pictures of Spears while she shops for clothes and accessories on Robertson Boulevard, West Hollywood this May 10th morning.