'2009/09'에 해당되는 글 9건

Special Character Entity Table :: 2009/09/23 22:03

1. Character entity references for ISO 8859-1 characters

Character Entity Numeric Entity Char Num Entity Description
        non-breaking space
¡ ¡ ¡ ¡ inverted exclamation mark
¢ ¢ ¢ ¢ cent sign
£ £ £ £ pound sign
¤ ¤ ¤ ¤ currency sign
¥ ¥ ¥ ¥ yen sign
¦ ¦ ¦ ¦ broken bar
§ § § § section sign
¨ ¨ ¨ ¨ diaeresis
© © © © copyright sign
ª ª ª ª feminine ordinal indicator
« « « « left-pointing double angle quotation mark
¬ ¬ ¬ ¬ not sign
­ ­ ­ ­ soft hyphen
® ® ® ® registered sign
¯ ¯ ¯ ¯ macron
° ° ° ° degree sign
± ± ± ± plus-minus sign
² ² ² ² superscript two
³ ³ ³ ³ superscript three
´ ´ ´ ´ acute accent
µ µ µ µ micro sign
¶ ¶ pilcrow sign
· · · · middle dot
¸ ¸ ¸ ¸ cedilla
¹ ¹ ¹ ¹ superscript one
º º º º masculine ordinal indicator
» » » » right-pointing double angle quotation mark
¼ ¼ ¼ ¼ vulgar fraction one quarter
½ ½ ½ ½ vulgar fraction one half
¾ ¾ ¾ ¾ vulgar fraction three quarters
¿ ¿ ¿ ¿ inverted question mark
À À À À latin capital letter A with grave
Á Á Á Á latin capital letter A with acute
    latin capital letter A with circumflex
à à à à latin capital letter A with tilde
Ä Ä Ä Ä latin capital letter A with diaeresis
Å Å Å Å latin capital letter A with ring above
Æ Æ Æ Æ latin capital letter AE
Ç Ç Ç Ç latin capital letter C with cedilla
È È È È latin capital letter E with grave
É É É É latin capital letter E with acute
Ê Ê Ê Ê latin capital letter E with circumflex
Ë Ë Ë Ë latin capital letter E with diaeresis
Ì Ì Ì Ì latin capital letter I with grave
Í Í Í Í latin capital letter I with acute
Î Î Î Î latin capital letter I with circumflex
Ï Ï Ï Ï latin capital letter I with diaeresis
Ð Ð Ð Ð latin capital letter ETH
Ñ Ñ Ñ Ñ latin capital letter N with tilde
Ò Ò Ò Ò latin capital letter O with grave
Ó Ó Ó Ó latin capital letter O with acute
Ô Ô Ô Ô latin capital letter O with circumflex
Õ Õ Õ Õ latin capital letter O with tilde
Ö Ö Ö Ö latin capital letter O with diaeresis
× × × × multiplication sign
Ø Ø Ø Ø latin capital letter O with stroke
Ù Ù Ù Ù latin capital letter U with grave
Ú Ú Ú Ú latin capital letter U with acute
Û Û Û Û latin capital letter U with circumflex
Ü Ü Ü Ü latin capital letter U with diaeresis
Ý Ý Ý Ý latin capital letter Y with acute
Þ Þ Þ Þ latin capital letter THORN
ß ß ß ß latin small letter sharp s
à à à à latin small letter a with grave
á á á á latin small letter a with acute
â â â â latin small letter a with circumflex
ã ã ã ã latin small letter a with tilde
ä ä ä ä latin small letter a with diaeresis
å å å å latin small letter a with ring above
æ æ æ æ latin small letter ae
ç ç ç ç latin small letter c with cedilla
è è è è latin small letter e with grave
é é é é latin small letter e with acute
ê ê ê ê latin small letter e with circumflex
ë ë ë ë latin small letter e with diaeresis
ì ì ì ì latin small letter i with grave
í í í í latin small letter i with acute
î î î î latin small letter i with circumflex
ï ï ï ï latin small letter i with diaeresis
ð ð ð ð latin small letter eth
ñ ñ ñ ñ latin small letter n with tilde
ò ò ò ò latin small letter o with grave
ó ó ó ó latin small letter o with acute
ô ô ô ô latin small letter o with circumflex
õ õ õ õ latin small letter o with tilde
ö ö ö ö latin small letter o with diaeresis
÷ ÷ ÷ ÷ division sign
ø ø ø ø latin small letter o with stroke
ù ù ù ù latin small letter u with grave
ú ú ú ú latin small letter u with acute
û û û û latin small letter u with circumflex
ü ü ü ü latin small letter u with diaeresis
ý ý ý ý latin small letter y with acute
þ þ þ þ latin small letter thorn
ÿ ÿ ÿ ÿ latin small letter y with diaeresis

2. Character entity references for symbols, mathematical symbols, and Greek letters

Character Entity Numeric Entity Char Num Entity Description
ƒ ƒ ƒ ƒ latin small f with hook
Α Α Α Α greek capital letter alpha
Β Β Β Β greek capital letter beta
Γ Γ Γ Γ greek capital letter gamma
Δ Δ Δ Δ greek capital letter delta
Ε Ε Ε Ε greek capital letter epsilon
Ζ Ζ Ζ Ζ greek capital letter zeta
Η Η Η Η greek capital letter eta
Θ Θ Θ Θ greek capital letter theta
Ι Ι Ι Ι greek capital letter iota
Κ Κ Κ Κ greek capital letter kappa
Λ Λ Λ Λ greek capital letter lambda
Μ Μ Μ Μ greek capital letter mu
Ν Ν Ν Ν greek capital letter nu
Ξ Ξ Ξ Ξ greek capital letter xi
Ο Ο Ο Ο greek capital letter omicron
Π Π Π Π greek capital letter pi
Ρ Ρ Ρ Ρ greek capital letter rho
Σ Σ Σ Σ greek capital letter sigma
Τ Τ Τ Τ greek capital letter tau
Υ Υ Υ Υ greek capital letter upsilon
Φ Φ Φ Φ greek capital letter phi
Χ Χ Χ Χ greek capital letter chi
Ψ Ψ Ψ Ψ greek capital letter psi
Ω Ω Ω Ω greek capital letter omega
α α α α greek small letter alpha
β β β β greek small letter beta
γ γ γ γ greek small letter gamma
δ δ δ δ greek small letter delta
ε ε ε ε greek small letter epsilon
ζ ζ ζ ζ greek small letter zeta
η η η η greek small letter eta
θ θ θ θ greek small letter theta
ι ι ι ι greek small letter iota
κ κ κ κ greek small letter kappa
λ λ λ λ greek small letter lambda
μ μ μ μ greek small letter mu
ν ν ν ν greek small letter nu
ξ ξ ξ ξ greek small letter xi
ο ο ο ο greek small letter omicron
π π π π greek small letter pi
ρ ρ ρ ρ greek small letter rho
ς ς ς ς greek small letter final sigma
σ σ σ σ greek small letter sigma
τ τ τ τ greek small letter tau
υ υ υ υ greek small letter upsilon
φ φ φ φ greek small letter phi
χ χ χ χ greek small letter chi
ψ ψ ψ ψ greek small letter psi
ω ω ω ω greek small letter omega
ϑ ϑ ϑ ϑ greek small letter theta symbol
ϒ ϒ ϒ ϒ greek upsilon with hook symbol
ϖ ϖ ϖ ϖ greek pi symbol
• • bullet
… … horizontal ellipsis
′ ′ primeminutes
″ ″ double prime
‾ ‾ overline
⁄ ⁄ fraction slash
℘ ℘ script capital P
ℑ ℑ blackletter capital I
ℜ ℜ blackletter capital R
™ ™ trade mark sign
ℵ ℵ alef symbol
← ← leftwards arrow
↑ ↑ upwards arrow
→ → rightwards arrow
↓ ↓ downwards arrow
↔ ↔ left right arrow
↵ ↵ downwards arrow with corner leftwards
⇐ ⇐ leftwards double arrow
⇑ ⇑ upwards double arrow
⇒ ⇒ rightwards double arrow
⇓ ⇓ downwards double arrow
⇔ ⇔ left right double arrow
∀ ∀ for all
∂ ∂ partial differential
∃ ∃ there exists
∅ ∅ empty set
∇ ∇ nabla
∈ ∈ element of
∉ ∉ not an element of
∋ ∋ contains as member
∏ ∏ n-ary product
∑ ∑ n-ary sumation
− − minus sign
∗ ∗ asterisk operator
√ √ square root
∝ ∝ proportional to
∞ ∞ infinity
∠ ∠ angle
∧ ∧ logical and
∨ ∨ logical or
∩ ∩ intersection
∪ ∪ union
∫ ∫ integral
∴ ∴ therefore
∼ ∼ tilde operator
≅ ≅ approximately equal to
≈ ≈ almost equal to
≠ ≠ not equal to
≡ ≡ identical to
≤ ≤ less-than or equal to
≥ ≥ greater-than or equal to
⊂ ⊂ subset of
⊃ ⊃ superset of
⊄ ⊄ not a subset of
⊆ ⊆ subset of or equal to
⊇ ⊇ superset of or equal to
⊕ ⊕ circled plus
⊗ ⊗ circled times
⊥ ⊥ up tack
⋅ ⋅ dot operator
⌈ ⌈ left ceiling
⌉ ⌉ right ceiling
⌊ ⌊ left floor
⌋ ⌋ right floor
⟨ 〈 left-pointing angle bracket
⟩ 〉 right-pointing angle bracket
◊ ◊ lozenge
♠ ♠ black spade suit
♣ ♣ black club suit
♥ ♥ black heart suit
♦ ♦ black diamond suit

3. Character entity references for markup-significant and internationalization characters

Character Entity Numeric Entity Char Num Entity Description
" " " " quotation mark
& & & & ampersand
&lt; &#60; < < less-than sign
&gt; &#62; > > greater-than sign
&OElig; &#338; Œ Œ latin capital ligature OE
&oelig; &#339; œ œ latin small ligature oe
&Scaron; &#352; Š Š latin capital letter S with caron
&scaron; &#353; š š latin small letter s with caron
&Yuml; &#376; Ÿ Ÿ latin capital letter Y with diaeresis
&circ; &#710; ˆ ˆ modifier letter circumflex accent
&tilde; &#732; ˜ ˜ small tilde
&ensp; &#8194; en space
&emsp; &#8195; em space
&thinsp; &#8201; thin space
&zwnj; &#8204; zero width non-joiner
&zwj; &#8205; zero width joiner
&lrm; &#8206; left-to-right mark
&rlm; &#8207; right-to-left mark
&ndash; &#8211; en dash
&mdash; &#8212; em dash
&lsquo; &#8216; left single quotation mark
&rsquo; &#8217; right single quotation mark
&sbquo; &#8218; single low-9 quotation mark
&ldquo; &#8220; left double quotation mark
&rdquo; &#8221; right double quotation mark
&bdquo; &#8222; double low-9 quotation mark
&dagger; &#8224; dagger
&Dagger; &#8225; double dagger
&permil; &#8240; per mille sign
&lsaquo; &#8249; single left-pointing angle quotation mark
&rsaquo; &#8250; single right-pointing angle quotation mark
&euro; &#8364; euro sign

Custom Role in Spring Security :: 2009/09/19 22:25

Spring Security에서 role은 기본적으로 "ROLE_"로 시작해야 한다. 그렇지 않으면 오류를 뱉어낸다. 만약 "PRIV_" 등 다른 접두사를 사용하거나 특별한 네임 규칙이 없는 다른 role명을 사용하던 기존 시스템에 Spring Security를 연결해야 한다면 추가적인 설정이 필요하다.

다음과 같이 Access Decision Manager를 정의하고, RoleVoter에 prefix를 재설정하면 된다.
<security:http auto-config="true"
    access-decision-manager-ref="accessDecisionManager">
...
</security:http>

<bean id="accessDecisionManager"
    class="org.springframework.security.vote.AffirmativeBased">
  <property name="allowIfAllAbstainDecisions" value="false" />
  <property name="decisionVoters">
    <list>
      <bean class="org.springframework.security.vote.RoleVoter">
        <property name="rolePrefix" value="" /> <-- ROLE_ -->
      </bean>
    </list>
  </property>
</bean>

New Links to WebLogic Server e-Docs :: 2009/09/14 12:36

기존 웹로직 서버 문서(edocs.bea.com)에 대한  새로운 링크들이다.

Spring Security 2.0.x Configuration :: 2009/09/13 23:06

Spring Security는 인증(Authentication)과 권한부여(Authorization)라는 기본 보안 기능 외에 다양한 시스템과의 인터페이스 및 확장 기능을 제공하는 보안 프레임워크이며, 구 Acegi Security 프레임워크에서 확장된 것이다.

Spring Security 프레임워크는 상당히 복잡하며 비즈니스 요구사항에 따라 매우 다양하게 구성할 수 있다. Java 기반 웹어플리케이션 보안을 위해서 기본적으로 16개의 보안 필터들을 제공하는데, 이들을 프로퍼티 등만 재지정하여 그대로 사용할 수도 있고, 상속하여 커스텀 필터를 작성 후 재지정하여 사용할 수도 있다. 일반적으로 이들 필터들을 모두 사용하지 않고 보안 요구사항에 따라 일부 필터들만을 지정하여 사용할 것이다.

Spring Security를 사용하기 위해서는 다음과 같이 web.xml에 보안 필터 체인 설정을 한다. 동시 로그인 세션수를 제어를 할 수 있는 Concurrent Session Filter를 사용하기 위해 웹 세션 이벤트를 읽는 리스너도 등록할 수 있다.
<filter>
  <filter-name>springSecurityFilterChain</filter-name>
  <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

<filter-mapping>
  <filter-name>springSecurityFilterChain</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

<!--
<listener>
  <listener-class>
    org.springframework.security.ui.session.HttpSessionEventPublisher
  </listener-class>
</listener>
-->

다음은 적용할 각 보안 필터들에 대한 스프링 컨텍스트 설정이 필요하다. 아래는 가장 단순한 형태의 Spring Security 설정의 예이다.
<beans:beans xmlns="http://www.springframework.org/schema/security"
  xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://www.springframework.org/schema/security
  http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
  
  <http auto-config='true'>
    <intercept-url pattern="/**" access="ROLE_USER" />
  </http>

  <authentication-provider>
    <user-service>
      <user name="user" password="user" authorities="ROLE_USER" />
    </user-service>
  </authentication-provider>

</beans:beans>

위 설정에서 http 요소에 auto-config="true"를 지정하면, 스프링은 아래와 같은 서블릿 필터들을 등록을 하게 되며, 이 필터들은 정해진 순서대로 순차적으로 각 필터의 역할을 수행하게 된다.
  • HttpSessionContextIntegrationFilter
  • LogoutFilter
  • AuthenticationProcessingFilter
  • DefaultLoginPageGeneratingFilter
  • BasicProcessingFilter
  • SecurityContextHolderAwareRequestFilter
  • RememberMeProcessingFilter
  • AnonymousProcessingFilter
  • ExceptionTranslationFilter
  • SessionFixationProtectionFilter
  • FilterSecurityInterceptor

아래는 같은 보안 설정에 대한 3가지의 다른 형태로 작성해 본 것이다. (Spring Security 2.0.x 기준).

Example 1
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
  xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">

  <!-- ===== HTTP AUTO CONFIG ======================================== -->

  <http auto-config="true" realm="My Security Realm"
    access-denied-page="/errors/accessDenied.jsp">
    <intercept-url pattern="/" filters="none" />
    <intercept-url pattern="/index*" filters="none" />
    <intercept-url pattern="/images/**" filters="none" />
    <intercept-url pattern="/scripts/**" filters="none" />
    <intercept-url pattern="/styles/**" filters="none" />
    <intercept-url pattern="/login.jsp*" access="ROLE_ANONYMOUS" />
    <intercept-url pattern="/admin**" access="ROLE_ADMIN" />
    <intercept-url pattern="/**" access="ROLE_USER,ROLE_ADMIN" />
    <intercept-url pattern="/**" access="IS_AUTHENTICATED_REMEMBERED" />

    <!--
    <concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true" />
    -->
    <logout logout-url="/j_security_logout" logout-success-url="/" />
    <form-login login-processing-url="/j_secutiry_check" login-page="/login.jsp"
      authentication-failure-url="/login.jsp?login_error=1"
      default-target-url="/" always-use-default-target="false" />
    <remember-me services-ref="rememberMeServices" key="someUniqueKey" />
    <http-basic />
    <anonymous />
  </http>

  <!-- ===== AUTHENTICATION PROVIDER ================================= -->

  <!--
  <authentication-provider>
    <user-service>
      <user name="admin" password="admin" authorities="ROLE_ADMIN,ROLE_USER" />
      <user name="user" password="user" authorities="ROLE_USER" />
    </user-service>
  </authentication-provider>

  <authentication-provider>
    <password-encoder hash="sha" />
    <user-service>
      <user name="admin" password="d033e22ae348aeb5660fc2140aec35850c4da997"
        authorities="ROLE_ADMIN,ROLE_USER" />
      <user name="user" password="12dea96fec20593566ab75692c9949596833adc9"
        authorities="ROLE_USER" />
    </user-service>
  </authentication-provider>

  <authentication-provider>
    <password-encoder hash="sha" base64="true" />
    <user-service>
      <user name="admin" password="0DPiKuNIrrVmD8IUCuw1hQxNqZc=" 
        authorities="ROLE_ADMIN,ROLE_USER" />
      <user name="user" password="Et6pb+wgWTVmq3VpLJlJWWgzrck="
        authorities="ROLE_USER" />
    </user-service>
  </authentication-provider>
  -->

  <!--( md5 | sha )-->
  <authentication-provider user-service-ref="userService">
    <password-encoder hash="sha" base64="true" />
  </authentication-provider>

  <beans:bean id="rememberMeServices"
    class="org.springframework.security.ui.rememberme.TokenBasedRememberMeServices">
    <beans:property name="userDetailsService" ref="userService" />
    <beans:property name="key" value="someUniqueKey" />
    <beans:property name="parameter" value="rememberMe" />
  </beans:bean>

  <!-- ===== LOGGER LISTENER ========================================= -->

  <beans:bean id="loggerListener"
    class="org.springframework.security.event.authentication.LoggerListener" />

</beans:beans>

Example 2
<?xml version="1.0" encoding="utf-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:security="http://www.springframework.org/schema/security"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/security 
    http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">

  <!-- ===== HTTP CONFIG ============================================= -->

  <security:http realm="My Security Realm"
    entry-point-ref="authenticationProcessingFilterEntryPoint"
    access-denied-page="/errors/accessDenied.jsp">

    <security:intercept-url pattern="/" filters="none" />
    <security:intercept-url pattern="/index*" filters="none" />
    <security:intercept-url pattern="/images/**" filters="none" />
    <security:intercept-url pattern="/scripts/**" filters="none" />
    <security:intercept-url pattern="/styles/**" filters="none" />
    <security:intercept-url pattern="/login.jsp*" access="ROLE_ANONYMOUS" />
    <security:intercept-url pattern="/admin**" access="ROLE_ADMIN" />
    <security:intercept-url pattern="/**" access="ROLE_USER,ROLE_ADMIN" />
    <security:intercept-url pattern="/**" access="IS_AUTHENTICATED_REMEMBERED" />

    <!--
    <security:concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true" />
    -->
    <security:http-basic />
    <security:anonymous />
  </security:http>

  <!-- ===== AUTHENTICATION MAMANGER & PROVIDER ====================== -->

  <security:authentication-manager alias="authenticationManager" />

  <security:authentication-provider user-service-ref="userService">
    <security:password-encoder hash="sha" base64="true" />
  </security:authentication-provider>

  <!-- ===== LOGOUT_FILTER =========================================== -->

  <bean id="logoutFilter" class="org.springframework.security.ui.logout.LogoutFilter">
    <!-- Sets this as the logout filter over the default -->
    <security:custom-filter position="LOGOUT_FILTER" />
    <constructor-arg value="/" />
    <constructor-arg>
      <list>
        <ref bean="rememberMeServices" />
        <bean
          class="org.springframework.security.ui.logout.SecurityContextLogoutHandler" />
      </list>
    </constructor-arg>
    <property name="filterProcessesUrl" value="/j_security_logout" />
  </bean>

  <!-- ===== AUTHENTICATION_PROCESSING_FILTER =======================  -->

  <bean id="authenticationProcessingFilterEntryPoint"
    class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
    <property name="loginFormUrl" value="/login.jsp" />
    <property name="forceHttps" value="false" />
  </bean>

  <bean id="authenticationProcessingFilter"
    class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter">
    <!-- Sets this as the authentication filter over the default -->
    <security:custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
    <property name="authenticationManager" ref="authenticationManager" />
    <property name="authenticationFailureUrl" value="/login.jsp?login_error=1" />
    <property name="defaultTargetUrl" value="/" />
    <property name="filterProcessesUrl" value="/j_security_check" />
    <property name="rememberMeServices" ref="rememberMeServices" />
    <property name="exceptionMappings">
      <props>
        <prop key="org.springframework.security.BadCredentialsException">/login.jsp?login_error=2</prop>
        <prop key="org.springframework.security.DisabledException">/login.jsp?login_error=3</prop>
        <prop key="org.springframework.security.LockedException">/login.jsp?login_error=4</prop>
        <prop key="org.springframework.security.AccountExpiredException">/login.jsp?login_error=5</prop>
        <prop key="org.springframework.security.CredentialsExpiredException">/login.jsp?login_error=6</prop>
        <prop key="org.springframework.security.concurrent.ConcurrentLoginException">/login.jsp?login_error=7</prop>
      </props>
    </property>
  </bean>

  <!-- ===== REMEMBER_ME_FILTER ====================================== -->

  <bean id="rememberMeProcessingFilter"
    class="org.springframework.security.ui.rememberme.RememberMeProcessingFilter">
    <!-- Sets this as the remember me filter over the default -->
    <security:custom-filter position="REMEMBER_ME_FILTER" />
    <property name="authenticationManager" ref="authenticationManager" />
    <property name="rememberMeServices" ref="rememberMeServices" />
  </bean>

  <bean id="rememberMeServices"
    class="org.springframework.security.ui.rememberme.TokenBasedRememberMeServices">
    <property name="userDetailsService" ref="userService" />
    <property name="key" value="someUniqueKey" />
    <property name="parameter" value="rememberMe" />
  </bean>

  <bean id="rememberMeAuthenticationProvider"
    class="org.springframework.security.providers.rememberme.RememberMeAuthenticationProvider">
    <security:custom-authentication-provider />
    <property name="key" value="someUniqueKey" />
  </bean>

  <!-- ===== LOGGER LISTENER ========================================= -->

  <bean id="loggerListener"
    class="org.springframework.security.event.authentication.LoggerListener" />

</beans>

Example 3
<?xml version="1.0" encoding="utf-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:security="http://www.springframework.org/schema/security"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">

  <!-- =============================================================== -->
  <!-- Spring Security Filter Chain                                    -->
  <!-- =============================================================== -->

  <bean id="springSecurityFilterChain" class="org.springframework.security.util.FilterChainProxy">
    <security:filter-chain-map path-type="ant">
      <security:filter-chain pattern="/" filters="none" />
      <security:filter-chain pattern="/index*" filters="none" />
      <security:filter-chain pattern="/images/**" filters="none" />
      <security:filter-chain pattern="/scripts/**" filters="none" />
      <security:filter-chain pattern="/styles/**" filters="none" />
      <security:filter-chain pattern="/**"
        filters="httpSessionContextIntegrationFilter,
                logoutFilter,
                authenticationProcessingFilter,
                basicProcessingFilter,
                securityContextHolderAwareRequestFilter,
                rememberMeProcessingFilter,
                anonymousProcessingFilter,
                exceptionTranslationFilter,
                filterSecurityInterceptor" />
    </security:filter-chain-map>
  </bean>

  <!-- =============================================================== -->
  <!-- FILTERS                                                         -->
  <!-- =============================================================== -->

  <!-- ===== CONCURRENT_SESSION_FILTER =============================== -->
  <!--
  <bean id="concurrentSessionFilter"
    class="org.springframework.security.concurrent.ConcurrentSessionFilter">
    <property name="sessionRegistry" ref="sessionRegistry" />
    <property name="expiredUrl" value="/" />
  </bean>

  <bean id="concurrentSessionController"
    class="org.springframework.security.concurrent.ConcurrentSessionControllerImpl">
    <property name="maximumSessions" value="1" />
    <property name="exceptionIfMaximumExceeded" value="true" />
    <property name="sessionRegistry" ref="sessionRegistry" />
  </bean>

  <bean id="sessionRegistry" class="org.springframework.security.concurrent.SessionRegistryImpl" />
  -->

  <!-- ===== SESSION_CONTEXT_INTEGRATION_FILTER ====================== -->

  <bean id="httpSessionContextIntegrationFilter"
    class="org.springframework.security.context.HttpSessionContextIntegrationFilter" />

  <!-- ===== LOGOUT_FILTER =========================================== -->

  <bean id="logoutFilter" class="org.springframework.security.ui.logout.LogoutFilter">
    <constructor-arg value="/" />
    <constructor-arg>
      <list>
        <ref bean="rememberMeServices" />
        <bean
          class="org.springframework.security.ui.logout.SecurityContextLogoutHandler" />
      </list>
    </constructor-arg>
    <property name="filterProcessesUrl" value="/j_security_logout" />
  </bean>

  <!-- ===== AUTHENTICATION_PROCESSING_FILTER =======================  -->

  <bean id="authenticationProcessingFilter"
    class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter">
    <property name="authenticationManager" ref="authenticationManager" />
    <property name="authenticationFailureUrl" value="/login.jsp?login_error=1" />
    <property name="defaultTargetUrl" value="/" />
    <property name="filterProcessesUrl" value="/j_security_check" />
    <property name="rememberMeServices" ref="rememberMeServices" />
    <property name="exceptionMappings">
      <props>
        <prop key="org.springframework.security.BadCredentialsException">/login.jsp?login_error=2</prop>
        <prop key="org.springframework.security.DisabledException">/login.jsp?login_error=3</prop>
        <prop key="org.springframework.security.LockedException">/login.jsp?login_error=4</prop>
        <prop key="org.springframework.security.AccountExpiredException">/login.jsp?login_error=5</prop>
        <prop key="org.springframework.security.CredentialsExpiredException">/login.jsp?login_error=6</prop>
        <prop key="org.springframework.security.concurrent.ConcurrentLoginException">/login.jsp?login_error=7</prop>
      </props>
    </property>
  </bean>

  <bean id="formAuthenticationEntryPoint"
    class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
    <property name="loginFormUrl" value="/login.jsp" />
    <property name="forceHttps" value="false" />
  </bean>

  <!-- ===== BASIC_PROCESSING_FILTER ================================= -->

  <bean id="basicProcessingFilter"
    class="org.springframework.security.ui.basicauth.BasicProcessingFilter">
    <property name="authenticationManager" ref="authenticationManager" />
    <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint" />
  </bean>

  <bean id="basicAuthenticationEntryPoint"
    class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">
    <property name="realmName" value="My Security Realm" />
  </bean>

  <!-- ===== SERVLET_API_SUPPORT_FILTER ============================== -->

  <bean id="securityContextHolderAwareRequestFilter"
    class="org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter" />

  <!-- ===== REMEMBER_ME_FILTER ====================================== -->

  <bean id="rememberMeProcessingFilter"
    class="org.springframework.security.ui.rememberme.RememberMeProcessingFilter">
    <property name="authenticationManager" ref="authenticationManager" />
    <property name="rememberMeServices" ref="rememberMeServices" />
  </bean>

  <bean id="rememberMeServices"
    class="org.springframework.security.ui.rememberme.TokenBasedRememberMeServices">
    <property name="userDetailsService" ref="userService" />
    <property name="key" value="someUniqueKey" />
    <property name="parameter" value="rememberMe" />
  </bean>

  <!-- ===== ANONYMOUS_FILTER ======================================== -->

  <bean id="anonymousProcessingFilter"
    class="org.springframework.security.providers.anonymous.AnonymousProcessingFilter">
    <property name="key" value="anonymous" />
    <property name="userAttribute" value="anonymous,ROLE_ANONYMOUS" />
  </bean>

  <!-- ===== EXCEPTION_TRANSLATION_FILTER ============================ -->

  <bean id="exceptionTranslationFilter" 
      class="org.springframework.security.ui.ExceptionTranslationFilter">
    <property name="authenticationEntryPoint" ref="formAuthenticationEntryPoint" />
    <property name="accessDeniedHandler">
      <bean class="org.springframework.security.ui.AccessDeniedHandlerImpl">
        <property name="errorPage" value="/errors/accessDenied.jsp" />
      </bean>
    </property>
  </bean>

  <!-- ===== FILTER_SECURITY_INTERCEPTOR ============================ -->

  <bean id="filterSecurityInterceptor"
    class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
    <property name="authenticationManager" ref="authenticationManager" />
    <property name="accessDecisionManager" ref="accessDecisionManager" />
    <property name="objectDefinitionSource">
      <security:filter-invocation-definition-source
        id="filterInvocationDefinitionSource" lowercase-comparisons="true"
        path-type="ant">
        <security:intercept-url pattern="/login.jsp*" access="ROLE_ANONYMOUS" />
        <security:intercept-url pattern="/admin**"
          access="ROLE_ADMIN" />
        <security:intercept-url pattern="/**"
          access="ROLE_USER,ROLE_ADMIN" />
      </security:filter-invocation-definition-source>
    </property>
  </bean>

  <bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased">
    <property name="allowIfAllAbstainDecisions" value="false" />
    <property name="decisionVoters">
      <list>
        <bean class="org.springframework.security.vote.RoleVoter" />
      </list>
    </property>
  </bean>

  <!-- =============================================================== -->
  <!-- AUTHENTICATION MANAGER & PROVIDER                               -->
  <!-- =============================================================== -->

  <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
    <property name="providers">
      <list>
        <ref local="daoAuthenticationProvider" />
        <ref local="anonymousAuthenticationProvider" />
        <ref local="rememberMeAuthenticationProvider" />
      </list>
    </property>
    <!--<property name="sessionController" ref="concurrentSessionController" />-->
  </bean>

  <bean id="daoAuthenticationProvider"
    class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
    <property name="userDetailsService" ref="userService" />
    <property name="passwordEncoder" ref="passwordEncoder" />
  </bean>

  <bean id="anonymousAuthenticationProvider"
    class="org.springframework.security.providers.anonymous.AnonymousAuthenticationProvider">
    <property name="key" value="anonymous" />
  </bean>

  <bean id="rememberMeAuthenticationProvider"
    class="org.springframework.security.providers.rememberme.RememberMeAuthenticationProvider">
    <property name="key" value="someUniqueKey" />
  </bean>

  <!--( ShaPasswordEncoder | Md5PasswordEncoder )-->
  <bean id="passwordEncoder"
    class="org.springframework.security.providers.encoding.ShaPasswordEncoder">
    <!--<constructor-arg value="256" />-->
    <property name="encodeHashAsBase64" value="true" />
  </bean>

  <!-- ===== LOGGER LISTENER ========================================= -->

  <bean id="loggerListener"
    class="org.springframework.security.event.authentication.LoggerListener" />

</beans>

Apache 2.2 + PHP 5.3 Integration :: 2009/09/11 21:01

윈도우 XP 환경에서 Apache 2.2와 PHP 5.3 연동 방법이다.

1. Apache 2.2 윈도우 인스톨 버전과 PHP 5.3 바이너리 ZIP 파일을 받아서 설치한다.
   * 본 문서 설치 버전: Apache 2.2.11, PHP 5.3.0

2. 아파치 기본 설정 파일(${APACHE_HOME}/conf/httpd.conf)에 다음과 같이 추가한다.
  - PHP 5 아파치 모듈과 php 확장자 처리를 위한 MIME 타입을 추가한다.
  - PHP 설치 디렉토리에 있는 php-*** 파일을 php.ini로 변경하고 해당 파일이 위치한 디렉토리를 설정한다.
  - 필요한 경우 기본 인덱스용 index.php를 등록한다.
# For PHP 5 do something like this:
LoadModule php5_module "C:/php-5.3.0/php5apache2_2.dll"
AddType application/x-httpd-php .php

# Configure the path to php.ini (rename php-* into php.ini):
PHPIniDir "C:/php-5.3.0"

# Add the following two lines inside :
#<IFMODULE mime_module>
#    AddType application/x-httpd-php .php
#    AddType application/x-httpd-php-source .phps
#</IFMODULE>

# Add default index file (index.php):
#<IFMODULE dir_module>
#    DirectoryIndex index.html index.php
#</IFMODULE>

3. PHP 확장 모듈을 사용할 경우 php.ini 파일을 열어서 extension_dir 설정 값을 찾아 주석을 풀고 다음처럼 확장 모듈이 있는 디렉토리를 지정한다. 또한 하단에 주석처리된 필요한 모듈 목록에서 필요한 모듈의 주석을 풀고 등록하면 된다.
extension_dir = "C:/php-5.3.0/ext"

...
extension=php_mysql.dll
...

4. PHP 동작을 확인하기 위해 아파치 서버를 재시작 후 아래 내용을 가진 php 파일을 생성하여 접속해 본다.
<?php phpinfo(); ?>

5. 정상적으로 설정이 된 경우 아래 그림과 같은 PHP 설정 정보 화면을 볼 수 있다.
User inserted image

Virtual Hosting with Tomcat :: 2009/09/07 23:51

Tomcat에서 가상 호스트 설정하는 방법이다. server.xml 파일에서 다음과 같이 <Host>를 추가한다. 호스트명에 대한 <Alias>를 지정할 수 있다.
<Engine name="Catalina" defaultHost="mydomain.com">

    <Host name="localhost" appBase="webapps" unpackWARs="true"
        autoDeploy="true" xmlValidation="false"
        xmlNamespaceAware="false">
    </Host>

    <Host name="mydomain.com" appBase="/home/mydomain"
        unpackWARs="true" autoDeploy="true" xmlValidation="false"
        xmlNamespaceAware="false">
        <Alias>www.mydomain.com</Alias>
        <Alias>test.mydomain.com</Alias>
        <Context path="" docBase="www" debug="0" />
    </Host>

</Engine>

참고: http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

Apache 2.2 + Tomcat 6.0 Integration :: 2009/09/07 22:38

윈도우 XP 환경에서 Apache 2.2와 Tomcat 6.0 연동 방법이다.

1. Apache 2.2 윈도우 인스톨 버전과 Tomcat 6.0 ZIP 파일을 받아서 설치한다.
   * 본 문서 설치 버전: Apache 2.2.11, Tomcat 6.0.18

2. 다음 mod_jk 모듈을 다운 받아 ${APACHE_HOME}/modules/mod_jk.so 위치에 복사한다.
3. Tomcat Worker 설정 파일(workers.properties)을 작성하여 ${APACHE_HOME}/conf 밑에 둔다. (위치는 상관없음).
# Define 1 real worker using ajp13
worker.list=worker1

# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

4. 아파치 기본 설정 파일(${APACHE_HOME}/conf/httpd.conf)에 다음과 같이 추가한다. 가상 호스트를 사용할 경우 Jk 모듈과 Jk Worker 파일 설정 이외의 설정은 개별 가상 호스트에 둘 수 있다.
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties
# Update this path to match your conf directory location
JkWorkersFile C:/Apache2.2/conf/workers.properties

#----- 아래 설정은 가상호스트 설정에 둘 수 있음 -----
# Where to put jk logs
# Update this path to match your logs directory location
#JkLogFile C:/Apache2.2/logs/mod_jk.log

# Set the jk log level [debug/error/info]
#JkLogLevel info

# Select the log format
#JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicate to send SSL KEY SIZE,
#JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
#JkRequestLogFormat "%w %V %T"

# Send everything for context /*.jsp to worker named worker1 (ajp13)
#JkMount /*.jsp worker1

# Send everything for context /examples to worker named worker1 (ajp13)
#JkMount /examples worker1
#JkMount /examples/* worker1

5. 아파치 가상호스트 설정 파일(${APACHE_HOME}/conf/extra/httpd-hosts.conf)을 편집하여 다음처럼 JkMount 설정을 추가한다. (주의: httpd.conf에서 httpd-vhosts.conf를 포함할 것).
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot "C:/Home/mydomain/htdocs"
    ServerAlias www.mydomain.com
    ServerAlias mydomain.com
    ServerAlias *.mydomain.com
    ErrorLog "C:/Home/mydomain/logs/mydomain.com-error.log"
    CustomLog "C:/Home/mydomain/logs/mydomain.com-access.log" common

    #----- 아래 JK 설정 -----
    # Where to put jk logs
    # Update this path to match your logs directory location
    JkLogFile C:/Home/mydomain/logs/mod_jk.log

    # Set the jk log level [debug/error/info]
    JkLogLevel info

    # Select the log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

    # JkOptions indicate to send SSL KEY SIZE,
    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

    # JkRequestLogFormat set the request format
    JkRequestLogFormat "%w %V %T"

    # Send everything for context /*.jsp to worker named worker1 (ajp13)
    JkMount /*.jsp worker1

    # Send everything for context /examples to worker named worker1 (ajp13)
    JkMount /examples worker1
    JkMount /examples/* worker1
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@java2go.net
    DocumentRoot "C:/Home/dummy-host/htdocs"
    ServerName dummy-host.com
    ServerAlias www.dummy-host.com
    ErrorLog "C:/Home/dummy-host/logs/dummy-host.com-error.log"
    CustomLog "C:/Home/dummy-host/logs/dummy-host.com-access.log" common
</VirtualHost>

6. Tomcat 서버의 server.xml에서 다음과 같은 설정을 확인한다.
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

7. Apache 서버와 Tomcat 서버를 구동 후 http://localhost/examples 주소를 접속하여 확인한다.
User inserted image

Calendar Date Format :: 2009/09/04 23:24

각 나라별 날짜 표기 관례는 지역별로 서로 다르다. 국제 표준 ISO 8601에 따른 표준 표기법은 우리나라 등에서 사용되는 big-endian (큰끝돌이?) 표기인 YYYY-MM-DD라는 것.


출처: http://en.wikipedia.org/wiki/Calendar_date

JavaScript Compressor :: 2009/09/03 23:41