스프링2011. 5. 18. 14:27

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>
Posted by 미랭군
자바·JSP2011. 5. 18. 12:43


1) exactly matching :: 우선순위 1
   - 반드시 "/"로 시작하고, 문자로 끝나야 한다.
  ex) <url-pattern>/Get</url-pattern>

2) directory matching :: 우선순위 2
   - 반드시 "/"로 시작하고 "*"로 끝나야한다.
  ex) <url-pattern>/Get/*</url-pattern>

3) extension matching :: 우선순위 3
   - "/"로 시작하면 안되고, 확장자로 끝나야한다.
  ex) <url-pattern>*.do</url-pattern>
Posted by 미랭군
자바·JSP2011. 5. 16. 16:07


Eclipse에서 작업하다보면 Project Explorer 상에 폴더나 파일 뒤에 파일명 + 리비전 번호 (ex: test.jsp 12345 )로 표시가 됩니다.
작업을 하다보면 내가 언제 작업을 했고, 누가 커밋을 했는지에 대한 정보가 필요할 때가 있습니다.
보통은 History perspective나 파일을 직접 열어서 확인을 하는데, Text Decorations 를 수정해 주시면
원하시는 정보가 파일명 뒤에 나오게 하실 수 있습니다. (ex: test.jsp 12345 2008-01-01 redrails )

우선 Window > Preferences에서 decoration으로 검색하시거나, Team > SVN > Lable Decorations 로 찾으신 뒤,

두번째 Tab Text Decorations를 선택합니다.

그리고 Format 부분에 File, Folder, Project 부분에서 보여질 부분을 선택하시면 됩니다.

{date}는 최종 수정 날짜이고, {author}는 마지막으로 커밋한 사람입니다.
그 외 필요하신 부분이 있으면 선택해 주시면 됩니다.
밑에 Preview 에서 바뀐 것들을 확인해 보실 수 있습니다.
그리고 Outgoing flag나 Added flag 부분의 문자열도 바꾸실 수 있습니다.


Posted by 미랭군