KEMBAR78
Spring Mvc | PDF
Spring MVC



   Ifnu Bima
     Artivisi

   ifnu.artivisi.com
 ifnubima@gmail.com
Spring Framework

Spring is a non-invasive application development
framework that aims to make the life easier for
Java/J2EE developers, by
●   Providing a DI (or IoC) container.
●   Providing an AOP framework that delivers services such as
    declarative transaction management.
●   Providing abstraction for more complicated (J2EE) services and
    APIs, which removes lot of ”boilerplate code”.
●   DI + AOP + Service Abstraction = Power to the POJO
Modules Of The Spring Framework


                                   Spring ORM                      Spring Web
                                Hibernate support              WebApplicationContext
                                  iBatis support                 Struts integration
                                   JDO support                   Tiles integration
                                                                   Web utilities
                                                                                               Spring MVC
        Spring AOP
                                                                                          Web MVC Framework
    AOP infrastructure
                                                                                               JSP support
     Metadata support
                                                                                       Velocity/FreeMarker support
   Declarative transaction
                                                                                           PFD/Excel support
       management
                                   Spring DAO                     Spring Context
                             Transaction Infrastructure           and Integration
                                  JDBC support                   ApplicationContext
                                  DAO support                  JNDI, EJB, JMS,Email,
                                                               Remoting, WebService




                                                    Spring Core
                                                    IoC Container
Spring MVC At A Glance

●   Spring’s own implementation of Web MVC (Model2)
●   Integrates nicely with the middle-tier via DI
●   Annotation Configuration significantly reduce XML
    configuration
●   The components of the web framework is loosely coupled
●   Supports several view technologies
          –   JSP/Tiles, Velocity, FreeMarker
●   Full control on HTTP low level aspect,
          – e.g. HTTP Response Header, Pragma Cache, Content Type, etc
●   Support all HTTP Method
          –   GET, POST, PUT,DELETE, HEAD, OPTIONS, TRACE
Spring MVC At A Glance

●   Great documentation
●   Spring Web Flow for conversational flow processing
●   Powerful security support with Spring Security :
         –   LDAP Authentication, X509, Role Based Authorization,
         –   Domain Object Access Control List, etc
●   Highly configurable URL :
         –   http://localhost/mystore/product/list
         –   Even we can do : http://localhost/mystore/productlist.php
●   Portlet MVC Framework
         –   Out of the box portlet developement to integrate with portlet container such
               as liferay
Spring MVC At A Glance

●   REST support coming up (Spring 3.0 currently Milestone 2)
         –   Pretty url, for example :
               http://localhost/mystore/product/list/id/2 Instead of
               http://localhost/mystore/product/list?id=2
●   Easy integration with javascript and Ajax library
         –   jQuery, Prototype, Dojo
●   Commonly used as backend data provider for Rich Client
    Frameworks
         –   GWT, Flex, OpenLaszlo
Spring Integration

Spring framework is not just about database and web. Spring also
support a lot of integration channel through different technology
such as:
●   Spring WebService
●   Remoting using RMI,Hessian or Burlap
●   Enterprise java beans (EJB) support
●   Java Messaging Service
●   Email
●   Scheduling
Whats new around spring?
●   OSGi is modular architecture where you simply put additional
    jar to your application, and all part of application recognice it as
    new application module, just as easy as plugin system.
●   SpringSource dm server
         –   completely module-based Java application server that is
               designed to run enterprise Java applications and
               Spring-powered applications with a high degree of
               flexibility and reliability
●   Spring Security
         –   provides powerful and flexible security solutions for
               enterprise applications developed using the Spring
               Framework
Whats new around spring?
●   Spring WS
     –   aims to facilitate contract-first SOAP service development, allowing
         for the creation of flexible web services using one of the many ways
         to manipulate XML payloads
●   Spring Integration
     –   provide a simple model for building enterprise integration solutions.
●   Spring Dynamic Module
     –   makes it easy to build Spring applications that run in an OSGi
         framework
●   Spring Batch
     –   provide bulk processing to perform business operations in mission
         critical environments
Whats new around spring?

●   Spring acquire Covalent, company which provide Tomcat
    commercial support
         –   Springsource is realy serious to transform SpringFramwork as full stack
               java ee solution
●   Spring acquire G2One Company behind groovy and grails.
         –   Groovy is new scripting language run in JVM
         –   Grails is groovy implementation of most productive framework rails
●   Spring acquire Terracota
         –   Terracota provide a technology that enable JVM clustering across multiple
                machine
         –   The most eficient and inovative way to cluster java application
Spring Community

●   Spring is very popular among java programmer.
●   Easy to find programmer with good spring skill.
●   Lots of forum, mailing list and QA site will answer spring related
    question. It means you will never stuck with unsolved problem.
●   Springframework.org is realy helpfull, all spring source
    employee, even rod johnson himself will answer any question in
    it's forum.
●   Spring official reference is documentation attached in spring
    framework download bundle. It cover almost all you need,
    means you never need to buy any book related to spring.
Case Study

●   LinkedIn
            –   34 million users around the world
            –   http://www.springsource.com/files/LinkedIn%20Case%20Study_0.pdf
●   Ariba
            –   Released AribaWeb as open source project. AribaWeb is actually an
                  internal framework used by Ariba over 10 years, it use spring heavily.
●   VOCA
            –   Voca processed over 5 billion transactions worth 4.5 million EURO in 2005
            –   http://java.dzone.com/links/voca_a_spring_casestudy.html
●   Many More
            –   http://www.springsource.com/customer/casestudies
Spring Stack

Spring provide full stack of java development, from core
application, middle tier (database), web and integration with other
system.
Implementing spring architecture means, putting the right
foundation for big and complex application. Once we use spring as
foundation, extending it with more feature is easy and seamless.
Big Spring implementation are there, so all related issue, bug,
pitfall or any problem are already solved. We need to learn from it
to avoid common mistake and to use proven architecture.
There all only positive opinion around internet about spring
implementation.
Springsource

●   Company behind Spring Framwork
●   Provide commercial support
●   Guarantee future development of Spring framework
●   Provide professional certification as spring developer
●   Actively involved in JCP to direct future of java
●   Mantain spring compatibility with older JVM Such as 1.4 version

Spring Mvc

  • 1.
    Spring MVC Ifnu Bima Artivisi ifnu.artivisi.com ifnubima@gmail.com
  • 2.
    Spring Framework Spring isa non-invasive application development framework that aims to make the life easier for Java/J2EE developers, by ● Providing a DI (or IoC) container. ● Providing an AOP framework that delivers services such as declarative transaction management. ● Providing abstraction for more complicated (J2EE) services and APIs, which removes lot of ”boilerplate code”. ● DI + AOP + Service Abstraction = Power to the POJO
  • 3.
    Modules Of TheSpring Framework Spring ORM Spring Web Hibernate support WebApplicationContext iBatis support Struts integration JDO support Tiles integration Web utilities Spring MVC Spring AOP Web MVC Framework AOP infrastructure JSP support Metadata support Velocity/FreeMarker support Declarative transaction PFD/Excel support management Spring DAO Spring Context Transaction Infrastructure and Integration JDBC support ApplicationContext DAO support JNDI, EJB, JMS,Email, Remoting, WebService Spring Core IoC Container
  • 4.
    Spring MVC AtA Glance ● Spring’s own implementation of Web MVC (Model2) ● Integrates nicely with the middle-tier via DI ● Annotation Configuration significantly reduce XML configuration ● The components of the web framework is loosely coupled ● Supports several view technologies – JSP/Tiles, Velocity, FreeMarker ● Full control on HTTP low level aspect, – e.g. HTTP Response Header, Pragma Cache, Content Type, etc ● Support all HTTP Method – GET, POST, PUT,DELETE, HEAD, OPTIONS, TRACE
  • 5.
    Spring MVC AtA Glance ● Great documentation ● Spring Web Flow for conversational flow processing ● Powerful security support with Spring Security : – LDAP Authentication, X509, Role Based Authorization, – Domain Object Access Control List, etc ● Highly configurable URL : – http://localhost/mystore/product/list – Even we can do : http://localhost/mystore/productlist.php ● Portlet MVC Framework – Out of the box portlet developement to integrate with portlet container such as liferay
  • 6.
    Spring MVC AtA Glance ● REST support coming up (Spring 3.0 currently Milestone 2) – Pretty url, for example : http://localhost/mystore/product/list/id/2 Instead of http://localhost/mystore/product/list?id=2 ● Easy integration with javascript and Ajax library – jQuery, Prototype, Dojo ● Commonly used as backend data provider for Rich Client Frameworks – GWT, Flex, OpenLaszlo
  • 7.
    Spring Integration Spring frameworkis not just about database and web. Spring also support a lot of integration channel through different technology such as: ● Spring WebService ● Remoting using RMI,Hessian or Burlap ● Enterprise java beans (EJB) support ● Java Messaging Service ● Email ● Scheduling
  • 8.
    Whats new aroundspring? ● OSGi is modular architecture where you simply put additional jar to your application, and all part of application recognice it as new application module, just as easy as plugin system. ● SpringSource dm server – completely module-based Java application server that is designed to run enterprise Java applications and Spring-powered applications with a high degree of flexibility and reliability ● Spring Security – provides powerful and flexible security solutions for enterprise applications developed using the Spring Framework
  • 9.
    Whats new aroundspring? ● Spring WS – aims to facilitate contract-first SOAP service development, allowing for the creation of flexible web services using one of the many ways to manipulate XML payloads ● Spring Integration – provide a simple model for building enterprise integration solutions. ● Spring Dynamic Module – makes it easy to build Spring applications that run in an OSGi framework ● Spring Batch – provide bulk processing to perform business operations in mission critical environments
  • 10.
    Whats new aroundspring? ● Spring acquire Covalent, company which provide Tomcat commercial support – Springsource is realy serious to transform SpringFramwork as full stack java ee solution ● Spring acquire G2One Company behind groovy and grails. – Groovy is new scripting language run in JVM – Grails is groovy implementation of most productive framework rails ● Spring acquire Terracota – Terracota provide a technology that enable JVM clustering across multiple machine – The most eficient and inovative way to cluster java application
  • 11.
    Spring Community ● Spring is very popular among java programmer. ● Easy to find programmer with good spring skill. ● Lots of forum, mailing list and QA site will answer spring related question. It means you will never stuck with unsolved problem. ● Springframework.org is realy helpfull, all spring source employee, even rod johnson himself will answer any question in it's forum. ● Spring official reference is documentation attached in spring framework download bundle. It cover almost all you need, means you never need to buy any book related to spring.
  • 12.
    Case Study ● LinkedIn – 34 million users around the world – http://www.springsource.com/files/LinkedIn%20Case%20Study_0.pdf ● Ariba – Released AribaWeb as open source project. AribaWeb is actually an internal framework used by Ariba over 10 years, it use spring heavily. ● VOCA – Voca processed over 5 billion transactions worth 4.5 million EURO in 2005 – http://java.dzone.com/links/voca_a_spring_casestudy.html ● Many More – http://www.springsource.com/customer/casestudies
  • 13.
    Spring Stack Spring providefull stack of java development, from core application, middle tier (database), web and integration with other system. Implementing spring architecture means, putting the right foundation for big and complex application. Once we use spring as foundation, extending it with more feature is easy and seamless. Big Spring implementation are there, so all related issue, bug, pitfall or any problem are already solved. We need to learn from it to avoid common mistake and to use proven architecture. There all only positive opinion around internet about spring implementation.
  • 14.
    Springsource ● Company behind Spring Framwork ● Provide commercial support ● Guarantee future development of Spring framework ● Provide professional certification as spring developer ● Actively involved in JCP to direct future of java ● Mantain spring compatibility with older JVM Such as 1.4 version