`
文章列表
<context:component-scan base-package="com.hiway.entity"></context:component-scan> <bean name="service" class="com.hiway.entity.UserService" scope="prototype"> </bean>   @Component("service") public class UserSer ...
Ribbon 是 Netflix 发布的云中间层服务开源项目,其主要功能是提供客户侧软件负载均衡算法,将 Netflix 的中间层服务连接在一起。Eureka 是一个 RESTful 服务,用来定位运行在 AWS 域(Region)中的中间层服务。本文介绍 Eureka 和 Ribbon 的集成,附带 Ribbon 自定义负载均衡算法示例。        Ribbon 和 Eureka 的集成,其实也就是让 Ribbon 充当 Eureka 架构中的 Application Client 角色。本文示例基于前边相关博客中的 demo 而写。阅读本文最好参考一下《云中间层服务 - 区域感知负载均 ...
什么是RestTemplate?    RestTemplate是Spring提供的用于访问Rest服务的客户端,RestTemplate提供了多种便捷访问远程Http服务的方法,能够大大提高客户端的编写效率。    调用RestTemplate的默认构造函数,RestTemplate对象在底层通过使用java.net包下的实现创建HTTP 请求,可以通过使用ClientHttpRequestFactory指定不同的HTTP请求方式。    ClientHttpRequestFactory接口主要提供了两种实现方式        一种是SimpleClientHttpRequestFactory ...
  @Component(“”)和@resource(name=””)的使用: spring的配置文件配置:   <?xml version="1.0" encoding="UTF-8"?> <beansxmlns="http://www.springframework.org/schema/beans"        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns:context="htt ...
springboot ant部署
package sample.xml;    import org.springframework.boot.builder.SpringApplicationBuilder;import org.springframework.boot.context.web.SpringBootServletInitializer;          @SuppressWarnings("deprecation")    public class ServletInitializer extends SpringBootServletInitializer {               ...
    @ResponseBody    @RequestMapping(            value = "upload", method = RequestMethod.POST, produces = "application/json; charset=utf-8")    @ApiOperation(value = "upload file svc",            notes = "multi part file upload.",            response = BaseRes ...
import static springfox.documentation.builders.PathSelectors.regex;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.bind.RelaxedPropertyResolver;import org.springframework.context.EnvironmentAware;import org.springframework.context.annotation.Bean;import org.spri ...
import java.net.InetAddress;import java.net.UnknownHostException;   public class ParseDomainName { InetAddress myServer = null; InetAddress myIPaddress = null; String domainName = null;    public ParseDomainName(String domainName) {  this.domainName = domainName; }    public InetAddress getSer ...
swing 模拟文件上传

ant 语法

    博客分类:
  • java
ant 
1、<project>标签 每个构建文件对应一个项目,project标签是构建文件的跟标签,它可以有多个内在属性,各个属性的含义分别如下所示: default表示默认的执行目标,这个属性是必须的。 basedir表示项目的基准路径,这个属性是必须 ...

ant 执行java代码

    博客分类:
  • java
您可以使用Ant来执行java代码。在下面这个例子中,java类中取一个参数(管理员的电子邮件地址),并发送了一封电子邮件。   public class NotifyAdministrator { public static void main(String[] args) { String email = args[0]; notifyAdministratorviaEmail(email); System.out.println("Administrator "+email+" has been notifie ...
首先,response返回有两种,一种是字节流outputstream,一种是字符流printwrite。   申明:这里为了方便起见,所有输出都统一用UTF-8编码。 先说字节流,要输出“中国",给输出流的必须是转换为utf-8的“中国”,还要告诉浏览器,用utf8来解析数据         //这句话的意思,是让浏览器用utf8来解析返回的数据          response.setHeader("Content-type", "text/html;charset=UTF-8");          String data = ...
java中判断字符编码以及转码   [参考]判断字符编码以及转码的一个工具类       
在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要。在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况。运行 top 命令后,CPU 使用状态会以全屏的方式显示,并且会处在对话的模式 -- 用 ...
Global site tag (gtag.js) - Google Analytics