Skip to content

Instantly share code, notes, and snippets.

package com.liguoliang.lang.collection;
import static org.junit.Assert.*;
import java.util.Iterator;
import org.junit.Before;
import org.junit.Test;
public class GListTest {
@gary-liguoliang
gary-liguoliang / gist:9481416
Last active March 23, 2016 06:00
Disable automatic redirect in HttpGet using HttpClient
// HttpClient Version: 4.3.3
RequestConfig requestConfig = RequestConfig.custom().setRedirectsEnabled(false).build();
httpGet.setConfig(requestConfig);
CloseableHttpResponse response = httpClient.execute(httpGet);
System.out.println("Status Code: " + response.getStatusLine().getStatusCode());
// Older version: http://stackoverflow.com/questions/1519392/how-to-prevent-apache-http-client-from-following-a-redirect
@gary-liguoliang
gary-liguoliang / gist:9403188
Last active September 3, 2015 10:01
Using JNDI in Spring - JNDI DataSource / Environment - using a <jee:jndi-lookup string inside an instance of PropertyPlaceholderConfigurer
<!-- by https://gist.github.com/prule/5523826 -->
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd">