Hiển thị các bài đăng có nhãn Java. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Java. Hiển thị tất cả bài đăng

Overview Of Endpoints Code - Defining Endpoint functions

Overview Of Endpoints Code - Defining Endpoint functions
Imports
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiMethod.HttpMethod;
import com.google.api.server.spi.config.Named;
Identify that this file contains endpoints functions
@Api(name = "helloworldendpoints", version = "v1",
            scopes = {Constants.EMAIL_SCOPE },
            clientIds = {Constants.WEB_CLIENT_ID, Constants.API_EXPLORER_CLIENT_ID },
            description = "API for hello world endpoints.")
ClientIds identify which clients are allowed to use these endpoint functions
To allow the API Explorer to use the endpoint functions, include Constant.API_EXPLORER_CLIENT_ID in the list of ClientIds:
import com.google.api.server.spi.Constant;

Constant.API_EXPLORER_CLIENT_ID;
Identifying methods as Endpoint Functions
When a file is marked with the @Api annotation, then by default all methods defined in the file are exposed as endpoint functions. However, you can specify the name, path and method (such as GET or POST) for each method.
For example:
    @ApiMethod(name = "sayHello", path = "sayHello", httpMethod = HttpMethod.GET)
For the full list of @Api annotations, see the Developer's Guide https://developers.google.com/appengine/docs/java/endpoints/annotations

How to install Java JDK7 on Ubuntu

Using Oracle Java 7 is not formally supported by Ubuntu. There's plenty solutions for installing it, listed on https://help.ubuntu.com/community/Java .
java_00_thumb
There is a simplest way to install Java7:
1. Open Terminal by “Ctrl+Alt+T”.
2. Run follow code:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
This will keep newest java 7.
3. Set up Java 7 environment variables JAVA_HOME and PATH:
sudo apt-get install oracle-java7-set-default
Well done!

How to install Java and Eclipse on Window?

How to install Java and Eclipse on Window?

java

Part1: Java JDK, skip if you have Java JDK on your computer

Eclipse comes with its own compiler, which means many people are able to write programs using Eclipse without installing the Java Development Kit (JDK for short). But having a working JDK is a very useful thing, and is an easy way to prevent potential issues later on. Because of this, we recommend installing the JDK to your system. In this class we have tested our files with Java versions 7 and 8, so if you have anything older than that, you’ll want to upgrade.
Step 1: Go to here to download Java JDK 7 or here to download JDK 8.
Step 2:
installjavastep1
1.  Click to Accept License Agreement.
2. Choose version JDK to downloads.
Step 3: Now open file that you have just downloaded.
installjavastep3
Step 4: Next the window below will install JDK on your computer.
installjavastep4
Well done! Close the window and go to Part 2.

Part 2: Install Eclipse

Step 1. Click here to download Eclipse.
Step2: Select your operating system from the dropdown menu. Then click 32 bit or 64 bit button to download version of Eclipse.
installjavapart2
Step 3: Click to Download button.
installjavapart23
Step 4: After complete download file, extract zip file by winrar or 7 zip.
Step 5:  Go to unzipped folder, run file eclipse.exe by run it or double-click it.
Step 6:  Eclipse will ask you select your workspace. This is where eclipse will store all of your code and project files. Optionally, you can make this default workspace(Eclipse will not ask you every time).
installjavapart24
Step 7:  The Eclispe open a wellcome screen that has links to lots of information including tut and overviews. You can try out some of these or click to workbench to getting started.
installjavapart25
Done. Congratulations!