service port is set to 3333, which is the configuration of the production environment (PROD)According to the above experiment, we can summarize the multi-environment configuration ideas as follows:Configure common content in application.properties and set Spring.profiles.active=dev to the default configuration of the development environmentConfigure different environments in Application-{profile}.propertiesActivating configuration of different enviro
Windows azure platform articles
I believe that after reading my blog post, I have a certain understanding of the Windows azure hosting service. In general, Windows azure services are divided into three types:
Windows azure website
Cloud Service
Virtual machines
If I am an enterprise-level user, which of the following services should I cho
Exception {MVC= Mockmvcbuilders.standalonesetup (NewHellocontroller ()). build (); } @Test Public voidGethello () throws Exception {Mvc.perform (mockmvcrequestbuilders.Get("/hello"). Accept (Mediatype.application_json)). Andexpect (Status (). IsOk ()). Andexpect (Content () .string(Equalto ("Hello World"))); } }
Use MockServletContext to build an empty one WebApplicationContext so that we can create HelloController it @Before and pass it to the function in the function MockMvcBuilders
(equalTo("Hello World"))); }}Use Mockservletcontext to build an empty webapplicationcontext, This allows the hellocontroller that we create to be created in the @before function and passed to the Mockmvcbuilders.standalonesetup () function.Note introduce the following to make the status, content, Equalto functions availableimport static org.hamcrest.Matchers.equalTo;import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;import static org.springframework.test.w
, throw MyException exception[Java] View plain copy@Controllerpublic class Hellocontroller {@RequestMapping("/json") public String json() throws MyException { throw new MyException("发生错误2"); } }Create a corresponding processing for a myexception exception[Java] View plain copy@ControllerAdvicepublic class Globalexceptionhandler {@ExceptionHandler(value = MyException.class) @ResponseBody public ErrorInfo}Launch app, Access: Http://localhost:8080/json, you can get the following return co
request = Get ("/users/"); Mvc.perform (Request) Andexpect (status () IsOk ()). Andexpect (Content (). String (Equalto (" [{\ "id\": 1,\ "name\": \ "Test master \", \ "age\": 20}])); 4, put modifies the user request with id 1 = put ("/users/1"). Param ("name", "Test Ultimate Master"). Para M ("Age", "30"); Mvc.perform (Request) Andexpect (content (). String (Equalto ("Success")); 5. Get a user request with id 1 = Get ("/USERS/1"); Mvc.perform (
First, review and elaborate on the @controller, @RestController, @RequestMapping annotations used in the QuickStart. If you are unfamiliar with spring MVC and have not yet tried a QuickStart case, it is recommended that you take a look at QuickStart content first.@Controller: Modifier class, used to create an object that handles HTTP requests@RestController: Note added after Spring4, the original return JSON in @controller need @ResponseBody to match, If you replace @controller directly with @re
velocity, freemarker, and so on. The main goal of Thymeleaf is to provide a well-formed template creation that can be properly displayed by the browser, so it can also be used as a static model. You can use it to create validated XML and HTML templates. Rather than writing logic or code, developers simply add tag attributes to the template. Next, these tag properties perform pre-established logic on the DOM (Document Object model).Sample Template:You can see that thymeleaf is mainly attributed
(NewHellocontroller ()). build (); } @Test Public voidGethello ()throwsException {mvc.perform (Mockmvcrequestbuilders.get ("/hello"). Accept (Mediatype.application_json)). Andexpect (Status (). IsOk ()). Andexpect (Content (). s Tring (Equalto ("Hello World"))); } }
Use MockServletContext to build an empty one WebApplicationContext so that we can create HelloController it @Before and pass it to the function in the function MockMvcBuilders.standaloneSetup() .
Note that the following
Cloud backup clients are primarily used for current server backup uploads and backup restores. The cloud Backup client provides a single server backup upload, the current server uploads
Local single File upload script, named UFThis is a test done on this machine, usingbpcs_uploaderScript implementation, just for a simple package, automatically improve the cloud file path.Technical points: UsingdirnameGet the directory where the files are located, usingpwdGets the full path to the file and serves as the path to the cloud file.#!/bin/bashcur_dir=$ (CD "$ (dirname") "; pwd" name=$ (basename "
Spring Cloud services Discovery service provider and service consumer
1. Service Providers
2. Service Providers
3. Start run
4. Comprehensive 1. Service Provider
According to the Eureka Registry of
The first attempt to back up an Oracle database to the AWS Cloud was typically backed up to a tape library or disk, and now it's easier to have a cloud. This is primarily backed up using AWS's S3 storage as an SBT device. As for what is AWS, what is S3, please refer to: http://www.amazonaws.cn/products/specific steps are as follows:Prerequisites: You will have an AWS Accunt (AWS access key ID and AWS secret
Using catalogs to easily store and reuse virtual components
In cloud computing, delivering infrastructure, a service solution, involves 3 main functional aspects:
Computational power to implement computing or virtual machine functions.
Storage capabilities facilitate the storage of data with compute nodes (as direct or indirect storage available to these nodes).
The network capability realizes the conne
. Box is a great service and a substitute for Dropbox. One disadvantage of Box cloud storage is that it does not have Linux clients like Dropbox.
One of its advantages is that Dropbox does not support backing up your files through the WebDAV protocol.
This brief tutorial will teach you how to use the Box cloud service
in the upper right corner, which is the most distinctive place I feel for multiple backups. There are also common features such as password modification, inviting friends to add traffic, and more.As a SaaS application, multi-backup makes a similar approach to Dropbox. Do not set up their own server, through the storage services to add multiple cloud facilities (including Baidu
Now you have upgraded or installed Ubuntu 14.04, but there is another thing you need to do to protect your new system: backup!
Ubuntu has a built-in Backup Tool named D é j à Dup Backup Tool. It allows you to back up your system and save it locally or on a remote server using different protocols.
There are also many other tools to back up your Ubuntu computer and
documents, and other documents.Ten. SyncthingSyncthing is an open source service that can replace BitTorrent Sync. This means that your data is not transmitted through anyone's server. But without the level of support that BitTorrent sync offers, the experience you get may not be as reliable. The two services are installed in a similar way, so if you prefer to have an open system, you might want to try Syncthing first.not all services are desirableWh
Registration Center: Service Registration and Enquiry (discovery)Service provider: The provider of the service, the party providing the service.Service consumer: The consumer of the service, the party using the service.We do not have a registration center, and service provid
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.