SlideShare a Scribd company logo
1 of 65
Download to read offline
17-C-5
     Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Simple
          Object
               	
Portable Service Abstraction	



     Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Application
                 	


   Framework
           	


Middle Ware
          	


  OS
   	


H/W
  	



          Developers Summit 2011
Roo/Grails
                       	
	
                                      	

                Spring
                     	


                Servlet
                            	
               	


                 JVM
                   	
     	




          Developers Summit 2011
vSphere	
                                App
                                  	

           App
             	
                                                   App
                                                     	


       vCloud	
                                                          Other Cloud	

App
  	
                                                          App
                                                            	

                               App
                                 	




                          Developers Summit 2011
Force.com                         Your Java App
 Platform
 Services                    Spring & Tomcat
                             VMware vCloud
                             VMware vSphere
    Force.com
     Database




    Developers Summit 2011
Your Java App
                                         Scaling(              ) and Load-
                                         balancing(               ) as a
                                         service
                                         Monitoring(    ) and diagnostics(   )
                                         as a service




                                                          &
          Force.com Database



                                    	


                           Developers Summit 2011
GWT
      	
                                Hyperic

                                                  	

  GAE/J

      Spring
          	




               Developers Summit 2011
Developers Summit 2011
SUSE Linux
             	

      vCloud
           	

     vSphere
           	




Developers Summit 2011
App
                   	
App
  	
                            App
                                  	




        Linux
            	

       vCloud
            	

       vSphere
             	




           Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Web     Service	
    Data Access	


                              JPA
                            Hibernate
          Spring               JDBC     HSQLDB	

      Spring tc Server




            Developers Summit 2011
@Controller
@RequestMapping("/login.form")
public class LoginController {
  private LoginService loginService;
  @Autowired
  public void setLoginService(LoginService loginService) {
    this.loginService = loginService;
  }
  ...
  @RequestMapping(method = RequestMethod.GET)                                   appContext-web.xml	
  public String setupForm(ModelMap model) {
                                                   <?xml version="1.0" encoding="UTF-8"?>
    if (loginService.isLogin()) {
                                                   <beans ...>
        model.addAttribute("login", loginService.getLoginUser());
        return loginService.getWelcomePage();       <context:component-scan
    } else {                                         base-package="sample.spring.mvc.web" />
                                                    <bean id="messageSource"
        model.addAttribute("login", new LoginBean());
        return loginService.getLoginPage();          class="org.springframework.context.support.
    }                                                   ResourceBundleMessageSource">
  }                                                  <property name="basename" value="messages" />
  …
}
                                                    </bean>
                                          </beans>
                                     Developers Summit 2011
<%@ page language="java" contentType="text/html; charset=Shift_JIS"
   pageEncoding="Shift_JIS" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>Login Page</title>
</head>
<body>
<h1>Login!</h1>
<form:form modelAttribute="login">
<table>
                                                                                  appContext-view.xml	
 <tr>                                           <?xml version="1.0" encoding="UTF-8"?>
   <td>Login Name:</td>
   <td>                                         <beans:beans ...>
     <form:input path="loginname"/>              <annotation-driven />
     <font color="red"><form:errors path="loginname"/></font>
   </td>
                                                 <resources mapping="/resources/**" location="/resources/" />
 </tr>                                           <beans:bean
 ....
 <tr>
                                                  class="org.springframework.web.servlet.view.
                                                    InternalResourceViewResolver">
   <td colspan="2"><input type="submit" name="Login" value="Login"></td>
 </tr>                                            <beans:property name="prefix" value="/WEB-INF/views/" />
</table>
</form:form>                                      <beans:property name="suffix" value=".jsp" />
</body>                                          </beans:bean>
</html>login.jsp	
                   </beans:beans>
                                         Developers Summit 2011
@Service("loginService")
public class LoginServiceImpl implements LoginService {
  @Autowired
  private MemberDao memberDao;
  public void setMemberDao(MemberDao memberDao) {
            this.memberDao = memberDao;
  }

    @Transactional(readOnly=true)
    public boolean login(String loginname, String password) {                     appContext-service.xml	
               List<LoginBean> beans = memberDao.findByLoginname(loginname);
                                                       <?xml version="1.0" encoding="UTF-8"?>
               if (beans.size() > 0) {                 <beans …>
                            LoginBean bean = beans.get(0);
                                                        <context:annotation-config/>
         if (bean.getPassword() != null &&              <context:component-scan
                            bean.getPassword().equals(password)) {
                                                          base-package="sample.spring.mvc.service"/>
             loginManager.setLoginUser(bean);
             return true;                               <bean id="loginManager" scope="session"
         }                                                  class="sample.spring.mvc.service.LoginManager">
               }                                          <aop:scoped-proxy/>
      return false;                                     </bean>
    }                                                  </beans>
}
                                        Developers Summit 2011
@Repository("memberDao")
public class MemberDaoImpl implements MemberDao {
 @PersistenceContext                                                                          appContext-dao.xml	
 EntityManager em;      <?xml version="1.0" encoding="UTF-8"?>
                               <beans…	
                                 <context:annotation-config/>
    public List<LoginBean> findByLoginname(String loginname) {
                                 <context:component-scan base-package="sample.spring.mvc.dao"/>
      Query query = em.createQuery(
                                 <bean id="entityManagerFactory"
                                     class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       "SELECT l FROM LoginBean l WHERE l.loginname = value="sample" />
                                  <property name="persistenceUnitName" :loginname");
      query.setParameter("loginname", loginname); ref="dataSource"/>
                                  <property name="dataSource"
                                  <property name="jpaVendorAdapter">
      return query.getResultList(); <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    }                                <property name="showSql" value="true" />
                                    </bean>
}                                 </property>
                                 </bean>
                                 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
                                 <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
                                 <property name="url" value="jdbc:hsqldb:hsql://localhost/"/>
                                 <property name="username" value="sa"/>
                                 <property name="password" value=""/>
                                 </bean>
                                 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
                                  <property name="entityManagerFactory" ref="entityManagerFactory"/>
                                 </bean>
                                 <tx:annotation-driven transaction-manager="transactionManager"/>
                               </beans>
                                               Developers Summit 2011
@Entity
@Table(name="member")
public class LoginBean implements Serializable {
  public LoginBean() {}
  @Id
  @GeneratedValue                 <?xml version="1.0" encoding="UTF-8"?>
  private Long id;                <persistence …>
  @Column(unique=true)             <persistence-unit name="sample"
  private String loginname;           transaction-type="RESOURCE_LOCAL">
                                    <provider>org.hibernate.ejb.HibernatePersistence</provider>
  private String password;
                                    <class>sample.spring.mvc.bean.LoginBean</class>
  @Column(name="name")              <exclude-unlisted-classes>false</exclude-unlisted-classes>
  private String nickname;          <properties>
  …                                   <property name="hibernate.dialect"
}                                        value="org.hibernate.dialect.HSQLDialect" />
                                       </properties>
                                      </persistence-unit>
                                     </persistence>

                                                                             persistence.xml	

                                     Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Web       Service	
    Data Access	


                                JPA
                              Datanucleus Web
                                                API	
            Spring              Connector               Force.com
                                                        Database	
  Spring tc Server on VMForce




              Developers Summit 2011
@Controller
@RequestMapping("/login.form")
public class LoginController {
  private LoginService loginService;
  @Autowired
  public void setLoginService(LoginService loginService) {
    this.loginService = loginService;
  }
  ...
  @RequestMapping(method = RequestMethod.GET)                                   appContext-web.xml	
  public String setupForm(ModelMap model) {
                                                   <?xml version="1.0" encoding="UTF-8"?>
    if (loginService.isLogin()) {
                                                   <beans ...>
        model.addAttribute("login", loginService.getLoginUser());
        return loginService.getWelcomePage();       <context:component-scan
    } else {                                         base-package="sample.spring.mvc.web" />
                                                    <bean id="messageSource"
        model.addAttribute("login", new LoginBean());
        return loginService.getLoginPage();          class="org.springframework.context.support.
    }                                                   ResourceBundleMessageSource">
  }                                                  <property name="basename" value="messages" />
  …
}
                                                    </bean>
                                          </beans>
                                     Developers Summit 2011
<%@ page language="java" contentType="text/html; charset=Shift_JIS"
   pageEncoding="Shift_JIS" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>Login Page</title>
</head>
<body>
<h1>Login!</h1>
<form:form modelAttribute="login">
<table>
                                                                                  appContext-view.xml	
 <tr>                                           <?xml version="1.0" encoding="UTF-8"?>
   <td>Login Name:</td>
   <td>                                         <beans:beans ...>
     <form:input path="loginname"/>              <annotation-driven />
     <font color="red"><form:errors path="loginname"/></font>
   </td>
                                                 <resources mapping="/resources/**" location="/resources/" />
 </tr>                                           <beans:bean
 ....
 <tr>
                                                  class="org.springframework.web.servlet.view.
                                                    InternalResourceViewResolver">
   <td colspan="2"><input type="submit" name="Login" value="Login"></td>
 </tr>                                            <beans:property name="prefix" value="/WEB-INF/views/" />
</table>
</form:form>                                      <beans:property name="suffix" value=".jsp" />
</body>                                          </beans:bean>
</html>login.jsp	
                   </beans:beans>
                                         Developers Summit 2011
@Service("loginService")
public class LoginServiceImpl implements LoginService {
  @Autowired
  private MemberDao memberDao;
  public void setMemberDao(MemberDao memberDao) {
            this.memberDao = memberDao;
  }

    @Transactional(readOnly=true)
    public boolean login(String loginname, String password) {                     appContext-service.xml	
               List<LoginBean> beans = memberDao.findByLoginname(loginname);
                                                       <?xml version="1.0" encoding="UTF-8"?>
               if (beans.size() > 0) {                 <beans …>
                            LoginBean bean = beans.get(0);
                                                        <context:annotation-config/>
         if (bean.getPassword() != null &&              <context:component-scan
                            bean.getPassword().equals(password)) {
                                                          base-package="sample.spring.mvc.service"/>
             loginManager.setLoginUser(bean);
             return true;                               <bean id="loginManager" scope="session"
         }                                                  class="sample.spring.mvc.service.LoginManager">
               }                                          <aop:scoped-proxy/>
      return false;                                     </bean>
    }                                                  </beans>
}
                                        Developers Summit 2011
@Repository("memberDao")
public class MemberDaoImpl implements MemberDao {
 @PersistenceContext
 EntityManager em;

    public List<LoginBean> findByLoginname(String loginname) {
      Query query = em.createQuery(                                          appContext-dao.xml	
       "SELECT l FROM LoginBean l WHERE l.loginname = :loginname");
                      <?xml version="1.0" encoding="UTF-8"?>
                      <beans ...>
      query.setParameter("loginname", loginname);
                       <context:annotation-config/>
      return query.getResultList();
                       <context:component-scan base-package="sample.spring.mvc.dao"/>
    }                  <bean id="entityManagerFactory"
}                         class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                       <property name="persistenceUnitName" value="sample" />
                      </bean>
                      <bean id="transactionManager"
                          class="org.springframework.orm.jpa.JpaTransactionManager">
                       <property name="entityManagerFactory" ref="entityManagerFactory"/>
                      </bean>
                      <tx:annotation-driven transaction-manager="transactionManager"/>
                     </beans>

                                       Developers Summit 2011
@Entity
@Table(name="member")
public class LoginBean implements Serializable {
                  ID
  public LoginBean() {}
                   String      <?xml version="1.0" encoding="UTF-8" standalone="no"?>

  @Id                       	
 <persistence ...>
                                <persistence-unit name="sample">
  @GeneratedValue(strategy = GenerationType.IDENTITY)
                                 <provider>org.datanucleus.jpa.PersistenceProviderImpl</provider>
  private String id;             <properties>
                                  <property name="datanucleus.Optimistic" value="false"/>
  @Column(unique=true)            <property name="datanucleus.datastoreTransactionDelayOperations" value="true"/>
  private String loginname;       <property name="sfdcConnectionName" value="DefaultSFDCConnection"/>
  private String password;        <property name="datanucleus.ConnectionURL"
                                         value="sfdc:https://xxx.salesforce.com/services/Soap/u/20.0"/>
  //@Column(name="name")          <property name="datanucleus.ConnectionUserName" value="xxx@xxx.com"/>
  private String nickname;        <property name="datanucleus.ConnectionPassword" value="xxxx"/>
  ...                             <property name="datanucleus.autoCreateSchema" value="false"/>
                                  <property name="datanucleus.autoCreateTables" force.com API
                                                                                     value="true"/>
}                                 <property name="datanucleus.autoCreateColumns" value="false"/>
                                  <property name="datanucleus.autoCreateConstraints" value="false"/>
                                                                                                        	
                       	
              <property name="datanucleus.validateTables" value="false"/>
                                       <property name="datanucleus.validateConstraints" value="false"/>
                                       <property name="datanucleus.jpa.addClassTransformer" value="false"/>
                                      </properties>
                                     </persistence-unit>
                                    </persistence>
                                            Developers Summit 2011                               persistence.xml
Developers Summit 2011
Developers Summit 2011
VMForce
 Extension
       	




             Developers Summit 2011
Developers Summit 2011
URL
                                	




                         	


                                     	




Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Web   Service	
   Data Access	


                           JPA
                         Datanucleus

        Spring             Connector




          Google AppEngine             BigTable	


         Developers Summit 2011
@Controller
@RequestMapping("/login.form")
public class LoginController {
  private LoginService loginService;
  @Autowired
  public void setLoginService(LoginService loginService) {
    this.loginService = loginService;
  }
  ...
  @RequestMapping(method = RequestMethod.GET)                                   appContext-web.xml	
  public String setupForm(ModelMap model) {
                                                   <?xml version="1.0" encoding="UTF-8"?>
    if (loginService.isLogin()) {
                                                   <beans ...>
        model.addAttribute("login", loginService.getLoginUser());
        return loginService.getWelcomePage();       <context:component-scan
    } else {                                         base-package="sample.spring.mvc.web" />
                                                    <bean id="messageSource"
        model.addAttribute("login", new LoginBean());
        return loginService.getLoginPage();          class="org.springframework.context.support.
    }                                                   ResourceBundleMessageSource">
  }                                                  <property name="basename" value="messages" />
  …
}
                                                    </bean>
                                          </beans>
                                     Developers Summit 2011
<%@ page language="java" contentType="text/html; charset=Shift_JIS"
   pageEncoding="Shift_JIS" isELIgnored="false" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>Login Page</title>
</head>
<body>
<h1>Login!</h1>
<form:form modelAttribute="login">
<table>
                                                                                  appContext-view.xml	
 <tr>                                           <?xml version="1.0" encoding="UTF-8"?>
   <td>Login Name:</td>
   <td>                                         <beans:beans ...>
     <form:input path="loginname"/>              <annotation-driven />
     <font color="red"><form:errors path="loginname"/></font>
   </td>
                                                 <resources mapping="/resources/**" location="/resources/" />
 </tr>                                           <beans:bean
 ....
 <tr>
                                                  class="org.springframework.web.servlet.view.
                                                    InternalResourceViewResolver">
   <td colspan="2"><input type="submit" name="Login" value="Login"></td>
 </tr>                                            <beans:property name="prefix" value="/WEB-INF/views/" />
</table>
</form:form>                                      <beans:property name="suffix" value=".jsp" />
</body>                                          </beans:bean>
</html>login.jsp	
                   </beans:beans>
                                         Developers Summit 2011
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>xxx</application>
<version>2</version>
<sessions-enabled>true</sessions-enabled> 	
</appengine-web-app>
                                           appengine-web.xml	
                                	




                           Developers Summit 2011
@Service("loginService")
public class LoginServiceImpl implements LoginService {
  @Autowired
  private MemberDao memberDao;
  public void setMemberDao(MemberDao memberDao) {
            this.memberDao = memberDao;
  }

    @Transactional(readOnly=true)
    public boolean login(String loginname, String password) {                     appContext-service.xml	
               List<LoginBean> beans = memberDao.findByLoginname(loginname);
                                                       <?xml version="1.0" encoding="UTF-8"?>
               if (beans.size() > 0) {                 <beans …>
                            LoginBean bean = beans.get(0);
                                                        <context:annotation-config/>
         if (bean.getPassword() != null &&              <context:component-scan
                            bean.getPassword().equals(password)) {
                                                          base-package="sample.spring.mvc.service"/>
             loginManager.setLoginUser(bean);
             return true;                               <bean id="loginManager" scope="session"
         }                                                  class="sample.spring.mvc.service.LoginManager">
               }                                          <aop:scoped-proxy/>
      return false;                                     </bean>
    }                                                  </beans>
}
                                        Developers Summit 2011
@Repository("memberDao")
public class MemberDaoImpl implements MemberDao {
 @PersistenceContext
 EntityManager em;

    public List<LoginBean> findByLoginname(String loginname) {
      Query query = em.createQuery(                                           appContext-dao.xml	
       "SELECT l FROM LoginBean l WHERE l.loginname = :loginname");
                      <?xml version="1.0" encoding="UTF-8"?>
                      <beans ...>
      query.setParameter("loginname", loginname);
                       <context:annotation-config/>
      return query.getResultList();
                       <context:component-scan base-package="sample.spring.mvc.dao"/>
    }                  <bean id="entityManagerFactory"
}                         class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                       <property name="persistenceUnitName" value="sample" />
                      </bean>
                      <bean id="transactionManager"
                          class="org.springframework.orm.jpa.JpaTransactionManager">
                       <property name="entityManagerFactory" ref="entityManagerFactory"/>
                      </bean>
                      <tx:annotation-driven transaction-manager="transactionManager"/>
                     </beans>

                                       Developers Summit 2011
@Entity
@Table(name="member")                                                           AppEngine
public class LoginBean implements Serializable {                                     JPA
 public LoginBean() {}                                                                   	

    @Id                       <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    @GeneratedValue(strategy =<persistence …>
                               GenerationType.IDENTITY)
                              <persistence-unit name="sample">
    private String id;         <provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider>
    //@Column(unique=true)     <properties>
    private String loginname;   <property name="datanucleus.NontransactionalRead" value="true"/>
                                <property name="datanucleus.NontransactionalWrite" value="true"/>
    private String password;    <property name="datanucleus.ConnectionURL" value="appengine"/>
    //@Column(name="name")      <property name="datanucleus.ConnectionUserName" value=""/>
    private String nickname;    <property name="datanucleus.ConnectionPassword" value=""/>
                                <property name="datanucleus.autoCreateSchema" value="false"/>
    ...                         <property name="datanucleus.autoCreateTables" value="true"/>
                           	
}                                      <property name="datanucleus.autoCreateColumns" value="false"/>
                                       <property name="datanucleus.autoCreateConstraints" value="false"/>
                                       <property name="datanucleus.validateTables" value="false"/>
                                       <property name="datanucleus.validateConstraints" value="false"/>
                                       <property name="datanucleus.jpa.addClassTransformer" value="false"/>
                                      </properties>
                                     </persistence-unit>
                                     </persistence>
                                              Developers Summit 2011                                persistence.xml
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011
Developers Summit 2011

More Related Content

What's hot

Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Arun Gupta
 
Liferay Devcon presentation on Workflow & Dynamic Forms
Liferay Devcon presentation on Workflow & Dynamic FormsLiferay Devcon presentation on Workflow & Dynamic Forms
Liferay Devcon presentation on Workflow & Dynamic FormsWillem Vermeer
 
Java server faces
Java server facesJava server faces
Java server facesowli93
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSFSoftServe
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVCJohn Lewis
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFMax Katz
 
Spring MVC
Spring MVCSpring MVC
Spring MVCyuvalb
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsKaml Sah
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Lou Sacco
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsBG Java EE Course
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component BehaviorsAndy Schwartz
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with MavenArcadian Learning
 
Gradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggugGradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggugkyon mm
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 DemystifiedAnkara JUG
 
Integrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePointIntegrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePointRob Windsor
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJosh Juneau
 

What's hot (20)

Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
 
Jsf Framework
Jsf FrameworkJsf Framework
Jsf Framework
 
Liferay Devcon presentation on Workflow & Dynamic Forms
Liferay Devcon presentation on Workflow & Dynamic FormsLiferay Devcon presentation on Workflow & Dynamic Forms
Liferay Devcon presentation on Workflow & Dynamic Forms
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
Java server faces
Java server facesJava server faces
Java server faces
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
 
Spring Portlet MVC
Spring Portlet MVCSpring Portlet MVC
Spring Portlet MVC
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSF
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Javabeans .pdf
Javabeans .pdfJavabeans .pdf
Javabeans .pdf
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
 
Gradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggugGradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggug
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 Demystified
 
Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)
 
Integrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePointIntegrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePoint
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 

Viewers also liked

Ο κόσμος από ψηλά
Ο κόσμος από ψηλάΟ κόσμος από ψηλά
Ο κόσμος από ψηλάnicodimosnis
 
Bike To Work Slides
Bike To Work SlidesBike To Work Slides
Bike To Work Slidessteverose76
 
Interactive Essay
Interactive EssayInteractive Essay
Interactive Essaysteverose76
 
9. TRIPLE PRODUCTO ESCALAR
9. TRIPLE PRODUCTO ESCALAR9. TRIPLE PRODUCTO ESCALAR
9. TRIPLE PRODUCTO ESCALARedvinogo
 

Viewers also liked (7)

Slideshow
SlideshowSlideshow
Slideshow
 
Signs
SignsSigns
Signs
 
Ο κόσμος από ψηλά
Ο κόσμος από ψηλάΟ κόσμος από ψηλά
Ο κόσμος από ψηλά
 
Bodylanguage
BodylanguageBodylanguage
Bodylanguage
 
Bike To Work Slides
Bike To Work SlidesBike To Work Slides
Bike To Work Slides
 
Interactive Essay
Interactive EssayInteractive Essay
Interactive Essay
 
9. TRIPLE PRODUCTO ESCALAR
9. TRIPLE PRODUCTO ESCALAR9. TRIPLE PRODUCTO ESCALAR
9. TRIPLE PRODUCTO ESCALAR
 

Similar to Spring as a Cloud Platform (Developer Summit 2011 17-C-5)

SpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptxSpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptxSUFYAN SATTAR
 
Deploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineAlexander Zamkovyi
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)Chitrank Dixit
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom Joshua Long
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointRene Modery
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892Tuna Tore
 
JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011Arun Gupta
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance JavaVikas Goyal
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Arun Gupta
 

Similar to Spring as a Cloud Platform (Developer Summit 2011 17-C-5) (20)

SpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptxSpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptx
 
Deploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App Engine
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 
JSF 2.0 Preview
JSF 2.0 PreviewJSF 2.0 Preview
JSF 2.0 Preview
 
WebGUI Developers Workshop
WebGUI Developers WorkshopWebGUI Developers Workshop
WebGUI Developers Workshop
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 
JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
 
Jsf
JsfJsf
Jsf
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
Resthub
ResthubResthub
Resthub
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Spring as a Cloud Platform (Developer Summit 2011 17-C-5)

  • 1. 17-C-5 Developers Summit 2011
  • 5. Simple Object Portable Service Abstraction Developers Summit 2011
  • 14. Application Framework Middle Ware OS H/W Developers Summit 2011
  • 15. Roo/Grails Spring Servlet JVM Developers Summit 2011
  • 16. vSphere App App App vCloud Other Cloud App App App Developers Summit 2011
  • 17. Force.com Your Java App Platform Services Spring & Tomcat VMware vCloud VMware vSphere Force.com Database Developers Summit 2011
  • 18. Your Java App Scaling( ) and Load- balancing( ) as a service Monitoring( ) and diagnostics( ) as a service & Force.com Database Developers Summit 2011
  • 19. GWT Hyperic GAE/J Spring Developers Summit 2011
  • 21. SUSE Linux vCloud vSphere Developers Summit 2011
  • 22. App App App Linux vCloud vSphere Developers Summit 2011
  • 25. Web Service Data Access JPA Hibernate Spring JDBC HSQLDB Spring tc Server Developers Summit 2011
  • 26. @Controller @RequestMapping("/login.form") public class LoginController { private LoginService loginService; @Autowired public void setLoginService(LoginService loginService) { this.loginService = loginService; } ... @RequestMapping(method = RequestMethod.GET) appContext-web.xml public String setupForm(ModelMap model) { <?xml version="1.0" encoding="UTF-8"?> if (loginService.isLogin()) { <beans ...> model.addAttribute("login", loginService.getLoginUser()); return loginService.getWelcomePage(); <context:component-scan } else { base-package="sample.spring.mvc.web" /> <bean id="messageSource" model.addAttribute("login", new LoginBean()); return loginService.getLoginPage(); class="org.springframework.context.support. } ResourceBundleMessageSource"> } <property name="basename" value="messages" /> … } </bean> </beans> Developers Summit 2011
  • 27. <%@ page language="java" contentType="text/html; charset=Shift_JIS" pageEncoding="Shift_JIS" isELIgnored="false" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <title>Login Page</title> </head> <body> <h1>Login!</h1> <form:form modelAttribute="login"> <table> appContext-view.xml <tr> <?xml version="1.0" encoding="UTF-8"?> <td>Login Name:</td> <td> <beans:beans ...> <form:input path="loginname"/> <annotation-driven /> <font color="red"><form:errors path="loginname"/></font> </td> <resources mapping="/resources/**" location="/resources/" /> </tr> <beans:bean .... <tr> class="org.springframework.web.servlet.view. InternalResourceViewResolver"> <td colspan="2"><input type="submit" name="Login" value="Login"></td> </tr> <beans:property name="prefix" value="/WEB-INF/views/" /> </table> </form:form> <beans:property name="suffix" value=".jsp" /> </body> </beans:bean> </html>login.jsp </beans:beans> Developers Summit 2011
  • 28. @Service("loginService") public class LoginServiceImpl implements LoginService { @Autowired private MemberDao memberDao; public void setMemberDao(MemberDao memberDao) { this.memberDao = memberDao; } @Transactional(readOnly=true) public boolean login(String loginname, String password) { appContext-service.xml List<LoginBean> beans = memberDao.findByLoginname(loginname); <?xml version="1.0" encoding="UTF-8"?> if (beans.size() > 0) { <beans …> LoginBean bean = beans.get(0); <context:annotation-config/> if (bean.getPassword() != null && <context:component-scan bean.getPassword().equals(password)) { base-package="sample.spring.mvc.service"/> loginManager.setLoginUser(bean); return true; <bean id="loginManager" scope="session" } class="sample.spring.mvc.service.LoginManager"> } <aop:scoped-proxy/> return false; </bean> } </beans> } Developers Summit 2011
  • 29. @Repository("memberDao") public class MemberDaoImpl implements MemberDao { @PersistenceContext appContext-dao.xml EntityManager em; <?xml version="1.0" encoding="UTF-8"?> <beans… <context:annotation-config/> public List<LoginBean> findByLoginname(String loginname) { <context:component-scan base-package="sample.spring.mvc.dao"/> Query query = em.createQuery( <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> "SELECT l FROM LoginBean l WHERE l.loginname = value="sample" /> <property name="persistenceUnitName" :loginname"); query.setParameter("loginname", loginname); ref="dataSource"/> <property name="dataSource" <property name="jpaVendorAdapter"> return query.getResultList(); <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> } <property name="showSql" value="true" /> </bean> } </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="org.hsqldb.jdbcDriver"/> <property name="url" value="jdbc:hsqldb:hsql://localhost/"/> <property name="username" value="sa"/> <property name="password" value=""/> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> </beans> Developers Summit 2011
  • 30. @Entity @Table(name="member") public class LoginBean implements Serializable { public LoginBean() {} @Id @GeneratedValue <?xml version="1.0" encoding="UTF-8"?> private Long id; <persistence …> @Column(unique=true) <persistence-unit name="sample" private String loginname; transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> private String password; <class>sample.spring.mvc.bean.LoginBean</class> @Column(name="name") <exclude-unlisted-classes>false</exclude-unlisted-classes> private String nickname; <properties> … <property name="hibernate.dialect" } value="org.hibernate.dialect.HSQLDialect" /> </properties> </persistence-unit> </persistence> persistence.xml Developers Summit 2011
  • 35. Web Service Data Access JPA Datanucleus Web API Spring Connector Force.com Database Spring tc Server on VMForce Developers Summit 2011
  • 36. @Controller @RequestMapping("/login.form") public class LoginController { private LoginService loginService; @Autowired public void setLoginService(LoginService loginService) { this.loginService = loginService; } ... @RequestMapping(method = RequestMethod.GET) appContext-web.xml public String setupForm(ModelMap model) { <?xml version="1.0" encoding="UTF-8"?> if (loginService.isLogin()) { <beans ...> model.addAttribute("login", loginService.getLoginUser()); return loginService.getWelcomePage(); <context:component-scan } else { base-package="sample.spring.mvc.web" /> <bean id="messageSource" model.addAttribute("login", new LoginBean()); return loginService.getLoginPage(); class="org.springframework.context.support. } ResourceBundleMessageSource"> } <property name="basename" value="messages" /> … } </bean> </beans> Developers Summit 2011
  • 37. <%@ page language="java" contentType="text/html; charset=Shift_JIS" pageEncoding="Shift_JIS" isELIgnored="false" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <title>Login Page</title> </head> <body> <h1>Login!</h1> <form:form modelAttribute="login"> <table> appContext-view.xml <tr> <?xml version="1.0" encoding="UTF-8"?> <td>Login Name:</td> <td> <beans:beans ...> <form:input path="loginname"/> <annotation-driven /> <font color="red"><form:errors path="loginname"/></font> </td> <resources mapping="/resources/**" location="/resources/" /> </tr> <beans:bean .... <tr> class="org.springframework.web.servlet.view. InternalResourceViewResolver"> <td colspan="2"><input type="submit" name="Login" value="Login"></td> </tr> <beans:property name="prefix" value="/WEB-INF/views/" /> </table> </form:form> <beans:property name="suffix" value=".jsp" /> </body> </beans:bean> </html>login.jsp </beans:beans> Developers Summit 2011
  • 38. @Service("loginService") public class LoginServiceImpl implements LoginService { @Autowired private MemberDao memberDao; public void setMemberDao(MemberDao memberDao) { this.memberDao = memberDao; } @Transactional(readOnly=true) public boolean login(String loginname, String password) { appContext-service.xml List<LoginBean> beans = memberDao.findByLoginname(loginname); <?xml version="1.0" encoding="UTF-8"?> if (beans.size() > 0) { <beans …> LoginBean bean = beans.get(0); <context:annotation-config/> if (bean.getPassword() != null && <context:component-scan bean.getPassword().equals(password)) { base-package="sample.spring.mvc.service"/> loginManager.setLoginUser(bean); return true; <bean id="loginManager" scope="session" } class="sample.spring.mvc.service.LoginManager"> } <aop:scoped-proxy/> return false; </bean> } </beans> } Developers Summit 2011
  • 39. @Repository("memberDao") public class MemberDaoImpl implements MemberDao { @PersistenceContext EntityManager em; public List<LoginBean> findByLoginname(String loginname) { Query query = em.createQuery( appContext-dao.xml "SELECT l FROM LoginBean l WHERE l.loginname = :loginname"); <?xml version="1.0" encoding="UTF-8"?> <beans ...> query.setParameter("loginname", loginname); <context:annotation-config/> return query.getResultList(); <context:component-scan base-package="sample.spring.mvc.dao"/> } <bean id="entityManagerFactory" } class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="sample" /> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> </beans> Developers Summit 2011
  • 40. @Entity @Table(name="member") public class LoginBean implements Serializable { ID public LoginBean() {} String <?xml version="1.0" encoding="UTF-8" standalone="no"?> @Id <persistence ...> <persistence-unit name="sample"> @GeneratedValue(strategy = GenerationType.IDENTITY) <provider>org.datanucleus.jpa.PersistenceProviderImpl</provider> private String id; <properties> <property name="datanucleus.Optimistic" value="false"/> @Column(unique=true) <property name="datanucleus.datastoreTransactionDelayOperations" value="true"/> private String loginname; <property name="sfdcConnectionName" value="DefaultSFDCConnection"/> private String password; <property name="datanucleus.ConnectionURL" value="sfdc:https://xxx.salesforce.com/services/Soap/u/20.0"/> //@Column(name="name") <property name="datanucleus.ConnectionUserName" value="xxx@xxx.com"/> private String nickname; <property name="datanucleus.ConnectionPassword" value="xxxx"/> ... <property name="datanucleus.autoCreateSchema" value="false"/> <property name="datanucleus.autoCreateTables" force.com API value="true"/> } <property name="datanucleus.autoCreateColumns" value="false"/> <property name="datanucleus.autoCreateConstraints" value="false"/> <property name="datanucleus.validateTables" value="false"/> <property name="datanucleus.validateConstraints" value="false"/> <property name="datanucleus.jpa.addClassTransformer" value="false"/> </properties> </persistence-unit> </persistence> Developers Summit 2011 persistence.xml
  • 43. VMForce Extension Developers Summit 2011
  • 45. URL Developers Summit 2011
  • 49. Web Service Data Access JPA Datanucleus Spring Connector Google AppEngine BigTable Developers Summit 2011
  • 50. @Controller @RequestMapping("/login.form") public class LoginController { private LoginService loginService; @Autowired public void setLoginService(LoginService loginService) { this.loginService = loginService; } ... @RequestMapping(method = RequestMethod.GET) appContext-web.xml public String setupForm(ModelMap model) { <?xml version="1.0" encoding="UTF-8"?> if (loginService.isLogin()) { <beans ...> model.addAttribute("login", loginService.getLoginUser()); return loginService.getWelcomePage(); <context:component-scan } else { base-package="sample.spring.mvc.web" /> <bean id="messageSource" model.addAttribute("login", new LoginBean()); return loginService.getLoginPage(); class="org.springframework.context.support. } ResourceBundleMessageSource"> } <property name="basename" value="messages" /> … } </bean> </beans> Developers Summit 2011
  • 51. <%@ page language="java" contentType="text/html; charset=Shift_JIS" pageEncoding="Shift_JIS" isELIgnored="false" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <title>Login Page</title> </head> <body> <h1>Login!</h1> <form:form modelAttribute="login"> <table> appContext-view.xml <tr> <?xml version="1.0" encoding="UTF-8"?> <td>Login Name:</td> <td> <beans:beans ...> <form:input path="loginname"/> <annotation-driven /> <font color="red"><form:errors path="loginname"/></font> </td> <resources mapping="/resources/**" location="/resources/" /> </tr> <beans:bean .... <tr> class="org.springframework.web.servlet.view. InternalResourceViewResolver"> <td colspan="2"><input type="submit" name="Login" value="Login"></td> </tr> <beans:property name="prefix" value="/WEB-INF/views/" /> </table> </form:form> <beans:property name="suffix" value=".jsp" /> </body> </beans:bean> </html>login.jsp </beans:beans> Developers Summit 2011
  • 52. <?xml version="1.0" encoding="utf-8" standalone="no"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>xxx</application> <version>2</version> <sessions-enabled>true</sessions-enabled> </appengine-web-app> appengine-web.xml Developers Summit 2011
  • 53. @Service("loginService") public class LoginServiceImpl implements LoginService { @Autowired private MemberDao memberDao; public void setMemberDao(MemberDao memberDao) { this.memberDao = memberDao; } @Transactional(readOnly=true) public boolean login(String loginname, String password) { appContext-service.xml List<LoginBean> beans = memberDao.findByLoginname(loginname); <?xml version="1.0" encoding="UTF-8"?> if (beans.size() > 0) { <beans …> LoginBean bean = beans.get(0); <context:annotation-config/> if (bean.getPassword() != null && <context:component-scan bean.getPassword().equals(password)) { base-package="sample.spring.mvc.service"/> loginManager.setLoginUser(bean); return true; <bean id="loginManager" scope="session" } class="sample.spring.mvc.service.LoginManager"> } <aop:scoped-proxy/> return false; </bean> } </beans> } Developers Summit 2011
  • 54. @Repository("memberDao") public class MemberDaoImpl implements MemberDao { @PersistenceContext EntityManager em; public List<LoginBean> findByLoginname(String loginname) { Query query = em.createQuery( appContext-dao.xml "SELECT l FROM LoginBean l WHERE l.loginname = :loginname"); <?xml version="1.0" encoding="UTF-8"?> <beans ...> query.setParameter("loginname", loginname); <context:annotation-config/> return query.getResultList(); <context:component-scan base-package="sample.spring.mvc.dao"/> } <bean id="entityManagerFactory" } class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="sample" /> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> </beans> Developers Summit 2011
  • 55. @Entity @Table(name="member") AppEngine public class LoginBean implements Serializable { JPA public LoginBean() {} @Id <?xml version="1.0" encoding="UTF-8" standalone="no"?> @GeneratedValue(strategy =<persistence …> GenerationType.IDENTITY) <persistence-unit name="sample"> private String id; <provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider> //@Column(unique=true) <properties> private String loginname; <property name="datanucleus.NontransactionalRead" value="true"/> <property name="datanucleus.NontransactionalWrite" value="true"/> private String password; <property name="datanucleus.ConnectionURL" value="appengine"/> //@Column(name="name") <property name="datanucleus.ConnectionUserName" value=""/> private String nickname; <property name="datanucleus.ConnectionPassword" value=""/> <property name="datanucleus.autoCreateSchema" value="false"/> ... <property name="datanucleus.autoCreateTables" value="true"/> } <property name="datanucleus.autoCreateColumns" value="false"/> <property name="datanucleus.autoCreateConstraints" value="false"/> <property name="datanucleus.validateTables" value="false"/> <property name="datanucleus.validateConstraints" value="false"/> <property name="datanucleus.jpa.addClassTransformer" value="false"/> </properties> </persistence-unit> </persistence> Developers Summit 2011 persistence.xml