Top Spring
![]() |
Spring Provides a Light-Weight Solution for Building Enterprise-Ready Applications
Spring provides a light-weight solution for building enterprise-ready applications, while still supporting the possibility of using declarative transaction management, remote access to your logic using RMI or web services, mailing facilities and various options in persisting your data to a database. Spring provides an MVC framework, transparent ways of integrating AOP into your software and a well-structured exception hierarchy including automatic mapping from proprietary exception hierarchies.
Spring could potentially be a one-stop shop for all your enterprise applications however, Spring is modular, allowing you to use parts of it, without having to bring in the rest
Spring Core
The core module is essentially the foundation for Spring. It provides fundamental features such as dependency injection and management of beans. Some of the top-level packages that fit under this module are org.springframework.beans, org.springframework.core, and org.springframework.util.
Spring Context
The context module is perhaps the second most important module in Spring, after the Spring Core module. It contains key classes such as ApplicationContext and WebApplicationContext, In addition, we will use the org.springframework.mail (for sending emails) and org.springframework.validation (for validating web UI fields) packages, which are also considered part of this module.
Spring AOP
We will not write AOP code directly using Spring. However, indirectly we will end up using Spring AOP-based facilities, such as interceptors for our web application and declarative transaction management. In fact, the Spring reference documentation mentions the same point; that is, if the prepackaged functionality provided in Spring is sufficient for your needs, you do not need to use Spring AOP (to write custom aspects, for example).
Spring DAO
Because we are already using Hibernate for database persistence, we do not need this module. However, this module is worth checking out if you like, or need, to work with JDBC but don't like all the tedious try-catch-finally blocks, opening/closing connections, and more. In addition, Spring goes one step further by providing a consistent exception hierarchy, which can convert vendor-specific checked exceptions into more consistent runtime exceptions that can be caught only in the layer of your application you want and ignore it in other places (thereby eliminating the need for cumbersome try/catch/finally code blocks).
Spring ORM
Spring's Object-Relational Map (ORM) module provides integration support for popular ORM products used by Java developers, such as Hibernate, JDO, Oracle TopLink, Apache OJB, and iBATIS SQL Maps.
Some of the benefits of using Spring's ORM support include ease of testing (via dependency injection), common data exceptions, persistent resource management (for example, Hibernate's SessionFactory), integrated enterprise-class transaction management, and more.
Benefits of Using Spring
• POJOs Spring enables to develop enterprise-class applications using POJOs. The benefit of using only POJOs is that you do not need an EJB container product such as an application server if your application doesn't require all the capabilities that such products provide. With Spring, you have the option of using only a robust servlet container such as Tomcat or some commercial product.
• Modular Spring is organized in a modular fashion. Even though the number of packages and classes is substantial, you have to worry only about ones you need. Hence, phasing Spring into an existing or new project can be done on a case-by-case and module-by-module basis.
• Complementary Spring does not reinvent the wheel; instead, it truly complements some of the existing work out there. For example, it complements several ORM frameworks, JEE, Quartz and JDK timers, other view technologies, and more.
• Testing Testing an application written with Spring is simple because environment-dependent code is moved into this framework (versus JNDI lookups embedded in code, for example). Furthermore, by using JavaBean-style POJOs, it becomes easier to use dependency injection for injecting test data (perhaps by using an XML file as the source of test data). In addition, Spring's mock classes can help you simulate classes such as an HTTP request object. This is primarily true because dependency injection works with setter and getter methods. Hence it is easy to inject test data into your objects and unit test your code using a product such as JUnit. This also includes testing of web components developed using Spring's web MVC framework, as you will see in the next chapter.
• Singletons Spring eliminates the need to maintain your own singleton classes. Instead, you write a class as a normal POJO (without the need for static variables/methods), and Spring ensures that you always get access to the same object, unless you override the default by defining a class as non singleton.
• Web framework Spring's web framework is a well-designed web MVC framework, which provides a great alternative to web frameworks such as Struts or other over engineered or less popular web frameworks. It enables you to develop no-form screens, simple-form screens, wizard like screens, and much more. It can also bind HTML form fields directly to the business objects instead of having to write custom classes that extend the web framework's classes. Spring Web MVC is also view agnostic, so it can work with Java Server Pages (JSP), Velocity, Java Server Faces (JSF), and others. In addition, the Spring Web Flow subproject can be used to develop web applications that require state management across several HTTP requests (an online airline-booking website, for example).
• Consistent exception hierarchy Spring provides a convenient API to translate technology-specific exceptions (thrown by JDBC, Hibernate, or JDO, for example) into consistent, unchecked exceptions (org.springframework.dao. PessimisticLockingFailureException, for example).
• Enterprise-class transaction management Spring provides a consistent transaction management interface that can scale down to a local transaction (using a single database, for example) and scale up to global transactions (using JTA, for example). Spring also provides application server-specific integration, for instance, with BEA's Web Logic Server and IBM's WebSphere. Spring's transaction management can be used programmatically or declaratively.
• Lightweight container IoC containers tend to be lightweight, especially when compared to EJB containers, for example. This can be beneficial, perhaps for developing and deploying applications on computers with limited memory and CPU resources.
Dependency Injection:
Dependency injection is a style of IoC; another style uses a template/callback technique. In both cases you are giving control to something else (hence, the term inversion of control). We will, of course, use the dependency injection style.
What is dependency injection exactly? Let's look at these two words separately. First, there is the dependency part; this basically translates into an association between two classes. For example, class A might need class B to get its job done. In other words, class A is dependent on class B. Now, let's look at the second part, injection. All this means is that class B will get injected into class A by the IoC container. This injection can happen in the way of passing parameters to the constructor or by post-construction using setter methods.
In other words, Class A depends on Class B hence, we will use Spring to automatically create a single instance of the Class B and inject (set) it via the ClassA. setClassB method.
Injection Styles
There are two key types of dependency injection styles: one via arguments passed to the constructor when an object is created and the other via the setter methods of a Java Bean style class, after the object has been created.
Spring advocates the use of setter-based dependency injection, because passing many arguments to the constructor can get cumbersome.
Although there are pros and cons to both approaches, considering that we are using Spring, we will go with Spring's recommendation and accordingly use setter-based injection.
a third type, interface injection.
Beans, BeanFactory, and ApplicationContext
The org.springframework.beans.factory.BeanFactory interface is the actual IoC container! It is an interface that essentially manages the application's configuration by instantiating and managing beans defined via code or, in our case, XML files. Beans can be any type of objects, but commonly are JavaBean style classes that is, classes with getters and setters.
The org.springframework.context.ApplicationContext essentially extends BeanFactory and adds additional facilities such as resource bundles, integration with Spring AOP, message resource handling, event broadcasting, and more. Furthermore, WebApplicationContext extends ApplicationContext by adding web application-specific context. Although you can use an implementation of the BeanFactory interface (for example, XmlBeanFactory), it is recommended that you use ApplicationContext for server-side applications.
The following list describes a couple of additional notes about beans:
• Beans can be created by Spring via the constructor (as you normally would using a new statement) or via static factory methods of another class.
• Each bean must have a unique id (for example, springtestmessage).
• Beans can be of two types, Singleton and Prototype (nonsingleton). By default, all beans are singletons, but you can make them prototypes by specifying an attribute such as singleton="false". We will use singletons most of the time because Spring cannot manage the life cycle of a prototype bean after it has been created and handed off to (injected in) the objects that depend on it. Also, by specifying singleton="false" for a given bean definition, you are instructing Spring to create a new instance of the bean every time there is a request for this bean. Last, almost 100% of the time, using singleton beans is sufficient.
• You can inject values in a setter method or constructor as single objects or as collection elements (for example, List, Set, Map, and Properties).
The spring-beans.xsd (or the older spring-beans.dtd) file provides the XML schema for the Spring Framework's application context file.
About the Author
Etisbew an Offshore Outsourcing Java Software Development Company and has an impressive track record and expertise in the latest spring hibernate, spring mvc, spring aop, spring webflow, spring net, spring security, spring hibernate struts, spring batch, Healthcare Software Solutions, Internet Marketing Techniques, Internet advertising techniques, Information Technology, Website Redesign, Custom Application Development, ColdFusion, Dotnet, Php, Java and Search Engine Optimization.
|
|
Super White Stuff OTC Pain Relief 3oz roll on $19.99 Super White Stuff OTC provides fast pain relief for Myalgia and Sprains. Super White Stuff OTC is contains no added dyes or fragrances.Benefits of Super White Stuff OTC: ?Fast pain relief for Arthritis, Myalgia, Bruises, Sprains, and Joint Pain?No Parabens, Natural Ingredients, Plus 11 Therapeutic Herbs, No added dyes or Fragrances?Registered with FDA as an OTC topical analgesic?Provides pain relief in as little as 5 minutes |
|
|
Super White Stuff OTC Pain Relief 4.4 oz jar $21.99 Super White Stuff OTC helps to increase mobility, and reduce muscle strains. Customers with sensitive skin or allergies love Super White Stuff OTC.Benefits of Super White Stuff OTC: ?Fast pain relief for Arthritis, Myalgia, Bruises, Sprains, and Joint Pain?No Parabens, Natural Ingredients, Plus 11 Therapeutic Herbs, No added dyes or Fragrances?Registered with FDA as an OTC topical analgesic?Provides pain relief in as little as 5 minutes |
|
|
Super White Stuff OTC Pain Relief 12oz bottle with pump $52.99 Super White Stuff OTC contains no parabens or harmful chemicals. Super White Stuff OTC help moisturize skin while provide fast pain relief.Benefits of Super White Stuff OTC: ?Fast pain relief for Arthritis, Myalgia, Bruises, Sprains, and Joint Pain?No Parabens, Natural Ingredients, Plus 11 Therapeutic Herbs, No added dyes or Fragrances?Registered with FDA as an OTC topical analgesic?Provides pain relief in as little as 5 minutes |
|
|
Moisture Replenishing Body Lotion with Emu Oil $13.99 Body Moisturizing Lotion with emu oil helps to provide essential nutrients to keep your skin soft all day. The Emu, Jojoba, and Sesame oil blend create a perfect body lotion.Benefits of Body Lotion with Emu Oil: ?Quickly rehydrates dry skin?Non-greasy feel?Absorbs quickly?Smells great |
|
|
Super Blue Stuff OTC Pain Relief Cream 3 OZ Roll on $14.99 Super Blue Stuff OTC relieves pain in as little as 5 minutes. The 3 oz Roll-on provides you with a longer reach f or those hard to reach areas where pain tends to migrate.Benefits of Super Blue Stuff OTC: ?Fast pain relief for Arthritis, Myalgia, Bruises, Sprains, and Joint Pain?No Parabens, Natural Ingredients, Plus 11 Therapeutic Herbs?Registered with FDA as an OTC topical analgesic?Provides pain relief in as little as 5 minutes |
|
|
Super Blue Stuff OTC Pain Relief Cream 4.4oz jar $18.99 Super Blue Stuff OTC decreases inflammation in joints and muscles naturally. Super Blue Stuff OTC 4.4 oz Jar is the most popular size. Benefits of Super Blue Stuff OTC: ?Fast pain relief for Arthritis, Myalgia, Bruises, Sprains, and Joint Pain?No Parabens, Natural Ingredients, Plus 11 Therapeutic Herbs?Registered with FDA as an OTC topical analgesic?Provides pain relief in as little as 5 minutes |
|
|
Super Blue Stuff OTC Pain Relief Cream 12oz bottle with pump $49.99 Super Blue Stuff OTC utilizes Emu Oil, Menthol, and MSM to provide well balanced natural pain relief. Super Blue Stuff OTC is safe to use every day with no side effects.Benefits of Super Blue Stuff OTC: ?Fast pain relief for Arthritis, Myalgia, Bruises, Sprains, and Joint Pain?No Parabens, Natural Ingredients, Plus 11 Therapeutic Herbs?Registered with FDA as an OTC topical analgesic?Provides pain relief in as little as 5 minutes |
|
|
Super White Stuff OTC Pain Relief 1oz jar $7.99 Super White Stuff OTC contains Emu Oil that absorbs quickly in the skin to provide you with fast pain relieving results. Super White Stuff OTC is registered with the FDA as an over the counter topical analgesic.Benefits of Super White Stuff OTC: ?Fast pain relief for Arthritis, Myalgia, Bruises, Sprains, and Joint Pain?No Parabens, Natural Ingredients, Plus 11 Therapeutic Herbs, No added dyes or Fragrances?Registered with FDA as an OTC topical analgesic?Provides pain relief in as little as 5 minutes |
|
|
Hair Formula + for Women 90 tablets $29.95 Hair Formula+ for Women helps to strengthen brittle or thin hair, improves elasticity, and promotes quality hair growth. Hair Formula+ for Women is safe to use every day.Benefits of Hair Formula+ for Women: ?Improves hair growth naturally?Increases hair strength?Contains essential nutrients for balanced health?Also improves nails and skin health |
|
|
Essential Emu Oil 90 softgel $44.99 Essential Emu Oil Soft Gel Caps contains Omega 3, 6, and 9 fatty acids. Essential fatty acids are vital for many bodily functions.Benefits of Essential Emu Oil Soft Gel Caps: ?Provides balanced dose of Essential Fatty Acids?Improves heart health?Aids in new cell generation?Essential for immune, nervous, and joint health |
|
|
Solaire Natural Tan Activator $19.99 Solaire is an All-Natural supplement designed to improve your tans appearance and maintain your tan longer with no side effects. Solaire increase melanin production in your skin so your tan last longer and may reduce your need for tanning exposure.Benefits of Solaire: ?Naturally increases melanin production?Reduces amount of tanning needed?Maintains your tan longer?Conditions skin for easier tanning |
|
|
Moisture Replenishing Hand Lotion with Emu Oil $13.99 BLUESPRING Hand Lotion with Emu Oil improves hand supple and softness. BLUESPRING Hand Lotion use Vitamin E and Emu Oil to absorb quickly without leaving your hand greasy. Benefits of Hand Lotion with Emu Oil: ?Heals dry, cracked, and chapped hands?Moisturizes and hydrates?Protects hand from elements that may damage skin?Gently smoothes hands |
|
|
AllergEeze 200 doses $8.99 AllergEeze is a All-Natural allergy powder designed to help your nose work better. AllergEeze is safe for everyday use and helps to fight pollen, grass, trees, and many more allergens. AllergEeze is specially formulated to coat the inside of your nose to provide you with long lasting allergy relief.Benefits of AllergEeze: ?Controls sneezing?Improves sinus congestion?Reduces runny nose?Relieves hay fever |
|
|
Lavender Emu Oil Soap $9.99 All-Natural Lavender Soap with Emu Oil helps to relieve stress and enhance skin quality. Ground Lavender petals helps to exfoliate skin but is safe to use every day.Benefits of Lavender Soap with Emu Oil: ?Relieves stress?Moisturizes skin?Exfoliates skin to improve skin health?Gentle to use everyday |
|
|
Hair Healthy Shampoo with Emu Oil $15.99 Healthy Hair Shampoo gently cleanses while providing essential nutrients to help protect your hair. The rich blend of emu and tea tree oil are the key ingredients to improving hair health.Benefits of Hair Healthy Shampoo with Emu Oil: ?Leaves your hair shiny and full of body?Gently nourishes hair and scalp with essential moisturizers?Nourishes scalp and helps to prevent dandruff?Smells Great |
|
|
Hair Healthy Conditioner with Emu Oil $15.99 Healthy hair conditioner is enriched with Aloe and Keratin protein to strengthen hair. Healthy hair conditioner improves hair shine, growth, and health. Safe for color treated hair.Benefits of Hair Healthy Conditioner with Emu Oil: ?Improves hair body and control?Increase hair strength and thickness with keratin proteins?Nourishes scalp and helps to prevent dandruff?Reduces hair static |
|
|
Joint Victory + 90 coated tablets $46.99 JointVictory+ is specifically formulated to improve joint mobility and reduce inflammation in joints. JointVictory+ uses an advanced blend of Curcumin, Boswella, and Rose Hips that studies have show to improve joint health.Benefits of JointVictory+: ?Improves joint circulation?Aids in joint relief?Reduces joint inflammation?Increases joint support |
|
|
Heartburn Relief 60 tablets $8.95 Heartburn Relief is designed to help control indigestion, gas, and upset stomach. Heartburn relief gently stimulates your body to heal itself naturally.Benefits of Indigestion Relief: ?Helps relieve stomach discomfort?Controls stomach cramp?Helps relieve sour stomach?Safe to use everyday |
|
|
Foot & Leg Comfort Cream with Emu Oil 2oz jar $7.99 Foot & Leg Comfort Cream with Emu Oil improves circulation and reduces fatigue for tired feet. Foot & Leg Comfort Cream works great for diabetics with common feet problems.Benefits of Body Lotion with Emu Oil: ?Provides fast relief with a cooling sensation?Non-greasy feel?Effectively moisturizes quickly for dry feet?Improves circulation?Deodorizes |
|
|
Pure Emu Oil 2oz $15.99 BLUESPRING Pure & Natural Emu oil absorbs quickly into the dermis layer of skin helping to moisturize and soften skin.Benefits of 100% Pure & Natural Emu Oil: ?AEA Certified Refined?Effective Moisturizer with fast absorption?Non-Comedogenic & Hypo-Allergenic?Rich in Essential Fatty Acids?No Parabens, Dyes, or Fragrances |
|
|
Active Formula 30 capsules $21.99 Active Formula helps to increase energy and reduce bodily fatigue naturally. Active Formula's four natural herbal extracts energizes your mind and body and can contribute to weight loss.Benefits of Active Formula: ?Improves energy levels?Help to fight against stress?Aids in reducing weight gain?Controls appetite |
|
|
Indigestion Relief 60 tablets $8.95 Indigestion Relief provides relief from bloating, nausea, and stomach cramping. When you over indulge let Indigestion Relief help to give you relief.Benefits of Indigestion Relief: ?Helps relieve stomach discomfort?Gently controls acid?Helps relieve sour stomach?Safe to use everyday |
|
|
Foot & Leg Comfort Cream with Emu Oil 8oz jar $22.99 Foot & Leg Comfort Cream with Emu Oil provides wonderful cooling sensation that feels great after a long day on your feet. Foot & Leg Comfort Cream also deodorizes and moisturizes your feet.Benefits of Body Lotion with Emu Oil: ?Provides fast relief with a cooling sensation?Non-greasy feel?Effectively moisturizes quickly for dry feet?Improves circulation?Deodorizes |
|
|
Pure Emu Oil 4oz $24.99 BLUESPRING Pure Emu Oil heals skin from burns, scars, and wrinkles. BLUESPRING Emu oil is hypo-allergenic for sensitive skin.Benefits of 100% Pure & Natural Emu Oil: ?AEA Certified Refined?Effective Moisturizer with fast absorption?Non-Comedogenic & Hypo-Allergenic?Rich in Essential Fatty Acids?No Parabens, Dyes, or Fragrances |
|
|
Stress Free Formula 30 capsules $22.99 Stress Free Formula is designed to reduce anxiety, help you relax in stress related times, and improve energy. Stress can lead to weight gain, damaged immune system, and depression. Stress Free Formula helps to relieve stress related occurrences so you have a clear mind to make important decisions.Benefits of Stress Free Formula: ?Relieves simple anxiety?Helps control stress?Helps to fight against stress related weight gain?Safe to use everyday |
|
|
Slimming Formula 60 tablets $8.95 Slimming Formula contains no caffeine, ephedra, or stimulants. Slimming Formula helps to reduce food cravings while controlling your appetite. Slimming Formula is non-habit forming and is safe to use every day.Benefits of Slimming Formula: ?Helps to control appetite?Curbs food cravings?No habit forming?No Ephedra |
|
|
Peach Facial Moisturizer with Emu Oil $19.99 Peach Facial Moisturizer helps to improve the appearance of wrinkles and helps to smooth fine lines. Peach Facial Moisturizer is safe and use every day. Peach Facial Moisturizer helps to regenerate new facial skin cells.Benefits of Peach Facial Moisturizer with Emu Oil: ?Helps to diminish fine lines and wrinkles?Gently moisturizes and hydrates?Non-comedogenic?Helps to smooth skin making you look younger |
|
|
Pure Emu Oil 8oz $46.99 BLUESPRING Pure Emu Oil is rich in Essential Fatty Acids which are necessary nutrients for skin repair and health.Benefits of 100% Pure & Natural Emu Oil: ?AEA Certified Refined?Effective Moisturizer with fast absorption?Non-Comedogenic & Hypo-Allergenic?Rich in Essential Fatty Acids?No Parabens, Dyes, or Fragrances |
|
|
MSM Natural 60 tablets $13.75 MSM Natural helps to support health in connective tissues, improve digestion, and increases energy production. MSM Natural is safe for everyday use.Benefits of MSM Natural: ?Improves joint health?Aids in digestion?Maintains cartilage health?Increases joint support |
|
|
Nico End Stop Smoking Aid 60 tablets $8.95 Nico-End is a tobacco free way to help stop smoking. Nico-end helps to curb cravings and end your desire to stop smoking naturally. Nico-end is safe to use every day with no side effects unlike patches or gum.Benefits of Nico-End: ?Helps relieve nicotine cravings?Helps to break smoking habit?Contains No Nicotine?Safe to use everyday |
|
|
White Under Eye Moisture Cream with Emu Oil $19.99 Under Eye Cream helps improve the appearance of crow?s feet, dark circles, and puffiness. Under Eye Cream is specially formulated for the fine skin under the eye.Benefits of Under Eye Cream with Emu Oil: ?Gently moisturizes and hydrates?Reduces dark circle appearance?Helps to diminish fine lines and crow's feet?Helps to smooth and reduce puffiness |
|
|
Lip Balm with Emu Oil $4.99 All-Natural Lip Balm with Emu Oil uses a unique blend of 5 essential oils to smooth and soften, dry chapped lips. Benefits of Lip Balm with Emu Oil: ?Moisturizes and hydrates?Heals dry cracked and chapped lips?Provides smooth and soft lips?Gentle to use everyday |
|
|
Allergy Relief 60 tablets $8.95 Allergy Relief provides temporary relief from sneezing, runny nose, and congestion. Most decongestants can make you drowsy. Allergy Relief is safe to use every day with no side effects. Benefits of Allergy Relief: ?Relieves watery eyes?Helps reduce sinus headaches?Reduces itchy and scratchy throat?Safe to use everyday |
|
|
Sinus Relief 60 tablets $8.95 Sinus Relief is designed to reduce sinus congestion, nasal pressure, and stuffy head symptoms. Sinus Relief also helps to reduce sinus headaches and bodily fatigue. Sinus Relief is a safe, over the counter homeopathic medicine.Benefits of Sinus Relief: ?Helps relieve sinus congestion?Helps runny nose?Reduces sinus pressure?Does not cause drowsiness |
|
|
Sore Throat Relief 60 tablets $8.95 Sore Throat Relief helps to improve throat discomfort related to swallowing and talking. Sore throats can occur from colds, cheering, and smoking. Sore Throat Relief is FDA approved as a homeopathic medication. Benefits of Sore Throat Relief: ?Improves sore throat?Relieves minor irritation?Reduces throat discomfort?No side effects |
|
|
Acne Remedy 60 tablets $8.95 Acne Remedy is a natural homeopathic that helps to fight acne from the inside out. Most treatments can burn or irritate skin. Acne Remedy helps to control breakouts. Acne Remedy is safe to use every day with no side effects.Benefits of Acne Remedy: ?Controls breakouts?Improves acne?Reduces blemishes |



US $16.99

































































































