4. Cloud Service
Because a lot of demand for cloud computing, and
technologies of cloud is getting better, many companies
have released some services that basic on Cloud, we
called it “Cloud Service”.
• Web service (Amazon EC2, GAE…)
• Storage (Amazon s3, hicloud s3, Google Cloud
Storage…)
• Music, movie (itunes)
5. 3-layer in Cloud Service
Web browser, mobile app…
SaaS (Software as a Service)
PaaS (Platform as a Service)
IaaS (Infrastructure as a Service)
8. 1. Support some useful APIs
Based on PaaS, GAE support
many useful APIs
For developers
Such as mail, map, youtube, and
most powerful is auth!
9. 2. OAuth2.0
Think about this Scenario:
Your app(third party) wants
to access user’s photo
placed in Google Storage,
The safest way is by Oauth,
but how the Oauth do it?
If you Use a non-OAuth app…
WHAT CONSEQUENCES YOU WILL
ENCOUNTER???
10. 3. Monitoring – Logs
You don’t need to implement a log record
system, GAE provides you a log control panel
which has a pretty UI, and useful filter.
11. 4. Storage
Store and manage data using a fully-managed, relational
MySQL database
Cloud Datastore provides a managed, NoSQL,
schemaless database for
storing non-relational data.
provides developers and IT teams with secure, durable,
highly-scalable object storage. with a simple web
services interface to store and retrieve any
amount of data from anywhere on the web.
16. Comparison: PaaS and IaaS
PaaS
IaaS
Google App Engine (GAE)
Microsoft Azure
Amazon EC2
Good Part of PaaS: machine and software configurations
has been set, moreover, the vendor may provide many
good api for you.
Bad Part: you need to allow the vender’s rules of environments
settings, programming languages, db. And PaaS project has bad
portability and hard to rework.
17. Good stuff… GCE
I prefer to use IaaS
production, but I hate AWS,
I want to use Google
production!
Let me show
you
something
good!
20. 2 ways to set ur dev environment
• 1. use MAVEN
• 2. use eclipse
21. The Google App Engine SDK and
Maven
• When you use Maven, you don't need to
download the Google App Engine SDK. Maven
does that for you. You'll also use Maven to test
your app locally and upload (deploy) it to
production App Engine.
The Eclipse IDE is available in several packages. The "Eclipse IDE for Java EE Developers" package includes all of the components you will need for web application development.
In addition to the Google Plugin for Eclipse, we recommend the Eclipse Web Tools Platform (WTP) plugins for web development. Among other things, WTP provides editing modes for JSP and HTML files.
Eclipese版本有很多,你要去下載的是Eclipse IDE for Java EE Developers,這個版本包含一些寫java web需要用到的東西
//Luna…月神
Start Eclipse
Select Help > Install New Software... In the dialog that appears, enter the update site URL into the Work with text box:https://dl.google.com/eclipse/plugin/4.4 And press the enter key.
只需要安裝 Google Plugin for Eclipse(required) 和 SDK -> Google App Engine Java SDK (1.9.4), 這兩個即可,但如果你很熟悉用dreamweaver這種拖拉式的網頁ide來寫網頁的話,你可以考慮安裝 Google web toolkit SDK 2.6.0,有了它,你要radio btn, table, div, inputbox,都可以直接拖拉來完成。
Using the Google Plugin for Eclipse
It's easy to use the Eclipse development environment to develop your Java App Engine application, just as you can to develop any other servlet-based web application. With the Google Plugin for Eclipse, it's even easier. The plugin lets you create, test, and upload App Engine applications from within Eclipse. You can also import an App Engine application packaged as a Maven project, and let Eclipse use Maven to manage dependencies and builds. (For more information, see Using Apache Maven.)
The Google Plugin for Eclipse also makes it easy to develop applications using Google Web Toolkit (GWT), to run on App Engine or in any other environment.
This article describes how to install the Google Plugin for Eclipse, create or import a new App Engine project, and debug it using the development server running within Eclipse. The article also describes how to use the plugin to upload your project to App Engine.
For more information about the plugin, including how to use it for Google Web Toolkit projects, see the Google Plugin for Eclipse documentation.
Getting Eclipse
Installing the Google Plugin for Eclipse
Creating a project
Importing a Maven project
Running the project
Uploading to Google App Engine
Running the command line tools
Getting Eclipse
The Eclipse IDE is available in several packages. The "Eclipse IDE for Java EE Developers" package includes all of the components you will need for web application development.
In addition to the Google Plugin for Eclipse, we recommend the Eclipse Web Tools Platform (WTP) plugins for web development. Among other things, WTP provides editing modes for JSP and HTML files.
Installing the Google Plugin for Eclipse
To use the plugin you must be running Java version 7 and a recent version of Eclipse. You can install the Google Plugin for Eclipse using the software update feature of Eclipse. Be sure to use the plugin that corresponds to your version of Eclipse. Follow the installation instructions provided at the links below or, if you are familiar with installing Eclipse plugins, you can simply paste the appropriate plugin link directly into Eclipse.
Eclipse versionInstallation instructionsDirect plugin linkEclipse 4.4 (Luna)Plugin for Eclipse 4.4 (Luna)https://dl.google.com/eclipse/plugin/4.4Eclipse 4.3 (Kepler)Plugin for Eclipse 4.3 (Kepler)https://dl.google.com/eclipse/plugin/4.3Eclipse 3.8/4.2 (Juno)Plugin for Eclipse 3.8/4.2 (Juno)https://dl.google.com/eclipse/plugin/4.2If you are looking for older versions of the plugin, click here.
If you are having trouble installing from the update sites (due to firewall issues, for instance), please see this FAQ entry.
As an alternative to installing from the update site, you can install the Google Plugin for Eclipse by downloading and installing an archive of the update site.
Creating a project
To create a new App Engine project:
Select the File menu > New > Web Application Project . If you do not see this menu option, select theWindow menu > Reset Perspective..., click OK, then try the File menu again. Alternatively, click the Google button in the Eclipse toolbar and select New Web Application Project.
The "Create a Web Application Project" wizard opens. For "Project name," enter a name for your project, such as Guestbook for the project described in the Getting Started Guide. For "Package," enter an appropriate package name, such as guestbook.
If you're not using Google Web Toolkit, uncheck "Use Google Web Toolkit." Verify that "Use Google App Engine" is checked.
If you installed the App Engine SDK using Software Update, the plugin is already configured to use the SDKs that were installed. If you would like to use a separate installation of the App Engine SDK, clickConfigure SDKs..., and follow the prompts to add a configuration with your SDK's appengine-java-sdk/directory.
Click Finish to create the project.
The wizard creates a directory structure for the project, including a src/ directory for Java source files, and awar/ directory for compiled classes and other files for the application, libraries, configuration files, static files such as images and CSS, and other data files. The wizard also creates a servlet source file and two configuration files. The complete directory structure looks like this:
Create jsp to shwo man
前端有種東西叫做表單 form,有一個屬性較method,method的值主要有四種,GET POST DELETE PUT,當你送出表單時,server side也就是 servlet要有相對應的method去接他,不然會有錯。
這段code是預設一個有著radio btn的表單Post到server時要做的事情,
Req.gerParameter會把表單中name屬性為boy的值取出來,另一個就是下面req.setAttribute