Posted
Filed under nginx

이미지 외부링크 차단하기

이미지 외부링크 차단하기 에 대한 설명이며
Nginx 기준입니다.
nginx.conf file에 아래의 정보를 추가하시면 됩니다.


localtion ~\.(jpg?g|png|gif)${

   valid_referers none blocked domain.com*.domain.com;
   if($invalid_referer){
       return403;
   }
}
2016/12/02 14:23 2016/12/02 14:23
Posted
Filed under JSP, JAVA

1. 맨 끝에 있는 콤마(,)를 제거하는 경우


<update id="updateAuthorIfNecessary" parameterType="domain.blog.Author">

UPDATE AUTHOR
<trim prefix="SET" suffixOverrides=",">
<if test="username != null">username=#{username},</if>
<if test="password != null">password=#{password},</if>
<if test="email != null">email=#{email},</if>
<if test="bio != null">bio=#{bio},</if>
</trim>
WHERE id=#{id}
</update>
 
맨앞에 SET을 붙이고 if안에 무엇이 들어가도 맨 끝에 있는 콤마를 지우겠다는 것이다.
 
 
 
2. 맨 앞에 있는 연산자를(AND 또는 OR) 제거하는 경우
 
 
<select id="selectInfo" parameterType="domain.blog.Author" resultType="authorResultMap">
 SELECT * FROM AUTHOR
 <trim prefix="WHERE" prefixOverrides="AND |OR">
<if test="username != null>AND username=#{username}</if>
<if test="password != null>OR password=#{password}</if>
<if test="email != null>AND email=#{email}</if>
</trim>
2016/12/01 15:08 2016/12/01 15:08
Posted
Filed under 웹표준
<input type="number" pattern="[0-9]*" inputmode="numeric" placeholder="">
2016/12/01 11:08 2016/12/01 11:08