Filed under nginx
다음과 같은 오류가 발생한다면, 버퍼 사이즈를 nginx에 설정 해줘야한다.

20xx/xx/xx xx:xx:xx [warn] ….an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/xxxx while readi
ng upstream, client:, server:, request: “GET /font/NanumGothic-Regular.woff HTTP/1.1”, upstream: “http:

http, location , server 중 아무데나 아래 값 추가 할 수 있음.
location에 추가함 .

proxy_buffering   on;
proxy_buffer_size    1024k;
proxy_buffers        1024   1024k;
2016/02/24 09:54 2016/02/24 09:54
Filed under C#


a =(int)Convert.ToDouble("1.2");

Note if you're using comma as a number separator in your operating system, you have to use IFormatProvider:

var a =(int)Convert.ToDouble("1.2",CultureInfo.InvariantCulture.NumberFormat);

Another way to accomplish this task:

var a =int.Parse("1.2".Split('.')[0]);

2016/02/12 18:38 2016/02/12 18:38
Filed under C#
I found this solution to work for me when trying to access a file share on another computer.  It basically simulates doing a NET USE command where you can specify the credentials to use on the remote end.  The nice part is that you do not have to impersonate the user and it works across domains and workgroup computers.

First, declare these functions and types in your class.

using System.Reflection;
using System.Runtime.InteropServices;
using System.ComponentModel;

public class YourClass {
private static extern int WNetAddConnection2A(ref NetResource pstNetRes, string psPassword, string psUsername, int piFlags);
private static extern int WNetCancelConnection2A(string psName, int piFlags, int pfForce);

private struct NetResource {
    public int iScope;
    public int iType;
    public int iDisplayType;
    public int iUsage;
    public string sLocalName;
    public string sRemoteName;
    public string sComment;
    public string sProvider;

private const int RESOURCETYPE_DISK = 0x1;

Then, add these two methods.
    private void LoginToShare(string serverName, string shareName, string user, string password) {
        string destinationDirectory = string.Format(@"\\{0}\{1}", serverName, shareName);

        NetResource nr = new NetResource();
        nr.iScope = 2;
        nr.iType = RESOURCETYPE_DISK;
        nr.iDisplayType = 3;
        nr.iUsage = 1;
        nr.sRemoteName = destinationDirectory;
        nr.sLocalName = null;

        int flags = 0;
        int rc = WNetAddConnection2A(ref nr, password, user, flags);

        if (rc != 0) throw new Win32Exception(rc);

    private void LogoutFromShare(string serverName, string shareName) {
        string destinationDirectory = string.Format(@"\\{0}\{1}", serverName, shareName);
        int flags = 0;
        int rc = WNetCancelConnection2A(destinationDirectory, flags, Convert.ToInt32(false));

In your code, call the LoginToShare with the server, share, user, and password needed.  Then simply use the standard \\server\share\path conventions for accessing files on remote computers.  Call the LogoutFromShare when you're done.

2016/01/26 10:05 2016/01/26 10:05
Filed under spring framework
[출처] :
classCombinedCommand(){Activity activity;Etabl etabl;//Getter and setter}


  method="post" commandName="combinedCommand"">...<form:input type="text"path="activity.x"/>...<form:input type="text"path="etabl.y"/>...</form:form>
2015/12/14 11:24 2015/12/14 11:24
Filed under JSP, JAVA

자바 Math 클래스에서 실수값 반올림이나 올림, 버림, 절대값을 구해주는 메서드가 있다.

static long Math.round(double a)
static int Math.round(float a)
예) System.out.println(Math.round(100.56)); //결과: 101

static double ceil(double a)

예) System.out.println(Math.ceil(100.56)); //결과: 101.0

static double floor(double a)

예) System.out.println(Math.floor(100.56)); //결과: 100.0

static double abs(double a)
static float abs(float a)
static int abs(int a)
static long abs(long a)

예) System.out.println(Math.abs(-100.56)); //결과: 100.56

참고로 소수 둘째자리에서 반올림을 하고 싶다고 하면 아래와 같이 응용한다.

double a = 100.22516;
double b = Math.round(a*100d) / 100d;
System.out.println(b); //결과: 100.23

원리는 차근차근 따라해 보면 쉽다.
일반 round() 메서드는 소수첫째자리에서 반올림 되기때문에 내가 반올림 하고자하는 자리수가 첫번째 소수점자리가 되도록 10 제곱을 곱해준다.
즉, 소수 2번째 자리까지 구하기 때문에 a에 10^2 하게되면 10022.516이 된다.
여기에서 반올림 한후 다시 나눈만큼 곱해주면 원래 소수 자리로 복원되게 된다.

다른 방법으로는 서식출력이 가능한 표준출력 메서드를 이용한 방법이다.
double a = 100.22516;
System.out.printf("%.2f",a); //결과 100.23

소수 둘째자리 실수로 반올림하여 출력하는 메서드이다.

간단한 내용이면서도 자주 활용되는 메서드에 대해 정리해보았습니다.
2015/12/03 16:14 2015/12/03 16:14
Filed under JSP, JAVA

 * Pathvariable example
 * @return
public String page(@PathVariable String var){
    String returnUrl = "";
    if(var.equals("one")) {
        returnUrl = "page1";
    } else if(var.equals("two")) {
        returnUrl = "page2";
    return returnUrl;
2015/11/18 17:46 2015/11/18 17:46
Filed under Linux
스프링의 web.xml에 utf-8 filter 를 추가 해주고도  한글이 께진다면 
tomcat 서버의 다음과 같이 설정을 해주면 한글 깨짐을 방지 할 수 있다.


 <Connector port="8080" protocol="HTTP/1.1"
               redirectPort="8443" URIEncoding="UTF-8"  />

2015/11/10 10:03 2015/11/10 10:03
Filed under PHP
foreach($_REQUEST as $key => $value ){
  ${"$key"} = $value;
2015/11/04 18:01 2015/11/04 18:01
Filed under centos7

If you receive an error while restarting IPtables on your virtual machine that includes : raw nat mangle filter [FAILED] or similar, this is a known error with CentOS 5 / CentOS 6 on virtual architectures. You simply need to modify the : /etc/init.d/iptables file.


Next, locate the below text, you can search for 'setting chains' Next add the lines labeled with + to the file, after the line with: case "$i"

vi /etc/init.d/iptables

echo -n $"${IPTABLES}: Setting chains to policy $policy: "
    for i in $tables; do
        echo -n "$i "
        case "$i" in

<!-- 추가된 부분 -->
+           security)

+               $IPTABLES -t filter -P INPUT $policy \
+                   && $IPTABLES -t filter -P OUTPUT $policy \
+                   && $IPTABLES -t filter -P FORWARD $policy \
+                   || let ret+=1
+               ;;

                $IPTABLES -t raw -P PREROUTING $policy \
                    && $IPTABLES -t raw -P OUTPUT $policy \
                    || let ret+=1

2015/11/02 16:33 2015/11/02 16:33
Filed under JSP, JAVA


* java

String orderKind  = "wbsalecount";

Map<String, Object> condition = new HashMap<String, Object>();
condition.put("orderKind" , orderKind );



* mybatis

<select id="selDomainMap1"   parameterType="java.util.Map" resultMap="libroBestsellerResultMap">   


                    <trim prefix="ORDER BY">
                        <if test="orderKind == 'wbrank'">  A.WB_RANK ASC </if>
                        <if test="orderKind == 'wbsalecount'">  A.WB_SALE_COUNT DESC </if>                       



2015/10/26 23:30 2015/10/26 23:30