用Spring创建iPhone App

This tutorial walks you through the generation of software components for use on the iPhone. This results in a fully implemented ready-to-run iPhone application that can be immediately used for validating and testing the generated iPhone components. Spring scaffolding for iPhone requires a MyEclipse Spring or Bling subscription. In this tutorial, you will learn how to:

  • Scaffold from database tables into an existing project
  • Deploy the app
  • Test in the Mobile Web Simulator

Duration Time: 20 Minutes

Don't have MyEclipse? Download Now

1. Create a Web Project

Create a MyEclipse Web project called  CustomersiPhoneApp.

Note: If you get a popup regarding the project compiler  compliance level not matching the workspace default, specify that you want to use a custom setting for the project by clicking Yes.

MyEclipse Spring iPhone
New web project


2. Scaffold from Database Tables

Scaffolding for iPhone requires the same steps as scaffolding with Spring MVC. Follow the steps in Scaffolding a Spring MVC Application with the following exception:

Select the Generate checkbox for iPhone on the Select Web Client Type wizard page.

MyEclipse Spring iPhone
Selecting the Spring iPhone web client

    Note: If you want to use the Spring DSL, then you need enable the project for Spring DSL support prior to scaffolding. See Enabling and Using Spring DSL for more information.


    3. Deploy the App and Test in the Simulator

    1. Right-click the MyEclipse Tomcat server in the Servers view, and select Add/Remove Deployment.
    2. Select CustomersiPhoneApp in the Available column, click Add, and click Finish.
      MyEclipse Spring iPhone
      Adding a project to the server
    3. Select Mobile>Mobile Web Simulator from the main menu to open the Mobile Web Simulator.
    4. Enter the following URL in the address bar: http://localhost:8080/CustomersiPhoneApp/.
      MyEclipse Spring iPhone
      Dashboard

      The iPhone application can be used to list all customers, view customer details, edit customer details, delete  customers and add new customers.

      MyEclipse Spring iPhone
      Customer app list
        MyEclipse Spring iPhone
        Customer app edit details


        4. What’s Generated?

        To ease your way into code generation with ME4S, this tutorial involved scaffolding from only a single database table. Therefore, only the software components for managing a single entity were generated, and there were no entity relationships. When you start generating for multiple entities, potentially with entity relationships, there are many more software components generated than were generated with this tutorial. Even though there’s a lot more code, it is grouped and organized as shown in the following  images.

        MyEclipse Spring iPhone  MyEclipse Spring iPhone
        Generated scaffolding
        • 0
          点赞
        • 0
          收藏
          觉得还不错? 一键收藏
        • 0
          评论
        评论
        添加红包

        请填写红包祝福语或标题

        红包个数最小为10个

        红包金额最低5元

        当前余额3.43前往充值 >
        需支付:10.00
        成就一亿技术人!
        领取后你会自动成为博主和红包主的粉丝 规则
        hope_wisdom
        发出的红包
        实付
        使用余额支付
        点击重新获取
        扫码支付
        钱包余额 0

        抵扣说明:

        1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
        2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

        余额充值