U E D R , A S I H C RSS

Spring/탐험스터디/wiki만들기

SimpleWiki

Spring Framework

Spring Security


  • UserDetail - 는 User 만들

    1. SecurityContextHolder
      Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
      
                      String name;
                      if (principal instanceof UserDetails) {
                        name = ((UserDetails)principal).getUsername();
                      } else {
                        name = principal.toString();
                      }
      
    2. Spring dependency injection
      public String write(@RequestParam("title") String title, @RequestParam("contents") String contents, Model model, Principal principal) {
      ...
      page.edit(contents, userRepository.get(principal.getName()));
      ...
      }
      

  • spring security tab library
    • spring security 능들 html/js .

<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec" %>
...
        <sec:authorize ifAllGranted="ROLE_USER">
                <input id="contents_edit" type="textarea" class="page_edit" value="${page.contents}" />
                <a href="#" class="page_edit" id="save">save</a>
        </sec:authorize>
...
        <sec:authorize url="/login">
                <a href="logout">Logout</a>
        </sec:authorize>

  • Spring Security Role Voter는 "ROLE_" . .

Hibernate

  • ORM(Object Relation Mapping) . Java persistence, EJB3.0 .
  • Lisence : LGPL

JSP

Markdown

  • 는 대 Markdown .
    • Markdown란 : wiki:Markdown
    • Java Markdown implementation Pegdown .
      • MarkdownJ, MarkdownPapers는 문 Pegdown 를 더 .
      • Pegdown
        1. pom.xml dependency
          <dependency>
                  <groupId>org.pegdown</groupId>
                  <artifactId>pegdown</artifactId>
                  <version>1.1.0</version>
          </dependency>
          
        2. markdown text를 html 문
          String html = new PegDownProcessor().markdownToHtml("markdown text");
          

CGLIB

  • CGLIB는 브러리(Code Generator Library) 런 () .

8 30


    • 2? 만 1.5 디를 . 를 봤 ... .
    • 만들!! 는 마 . .
      • 느낀 는 데미 무
    • TODO : write/delete 등 security

    • .
      • 는데 Markdown 면(Markdown 문 만) (명백 !) Markdown pegdown . Java 마 문(GitHub ) ....
      • pegdown 는데(new Pegdown().markdownToHTML(/* String */) 는데 .
      • ? . .

      • 를 보 Mock . . . Mock 를 벗 . ?
        • ( ) . .
    • .
    • .
      • Spring, Hibernate . CGLib, Spring Security, JSP, Session .
      • 모른.
    • 만들
      • pegdown Markdown
      • . .

9 13



    • .
      • , !

9 19



    • . .....
    • (리 9)는 jsp pageContext.getAttribute("page") Response page를 불러 는데 리 10부 pageContext.getRequst().getAttribute()(는 request.getAttribute)를 page를 불러 . ? 모르.
      • Scope .
    • Jasper는 JSP를 java .
      • home.jsp는 home_jsp.java

9 20


    • login.jsp 를 만들 .
      • 런데 Remember me .
    • save를 르면 는데 .

    • 면 login, signup등
      • spring security tag library ifAllGranted, ifNotGranted등 .
    • view
    • 를 돌, 만들 ?
      • GET 받는듯.
      • url mapping ?
      • pagdown page 링는 localhost:8080/simplewiki/를 localhost:8080/.
        • localhost:8080/ ?
      • ViewResolver? Intercept Handler?
    • . .
    • mac eclipse tomcat 데 caltalina를 못

9 27



    • PageTitle !! , PathVariable url path 를 받 .
      • 는 getServletPath()

10 4



    • 놀람

10 11



    • Page는 User 민. Page는 History 남는. 만들면 history는 남. User는 id는 남 history id 만들면 . User id 보(password, e-mail등..)를 .

11 01



    • User userId는 남 id User userId(String type) password,..(UserInfo.class)를 .
      • User는 UserInfo.( Composite)
      • User UserInfo는 Nullable ColumnUserInfo ForeignKey Contraint ..
      • User UserInfo 를 변 논리 림.
      • UserInfo field들 null등 ... + flag
      • 민.
    • 데 (내) . .
    • . 18000 .

11 21



    • Page History 보
      • url "/" Page내 Page history .
        • (page content view, page history view)를 만 더 (page view) subset Request parameter를 .
      • 롤러 OverLoading ResuestMapping Spring Ambiguous Mapping Exception .
        • RequestMappingHandlerMapping { URL , methods= Method , params=[],headers=[],consumes=[],produces=[],custom=[]}등 Request를 .
      • @RequestMapping params를 . RequestMapping .
        • RequestMapping value, Method 들링 .
        • 를들 @RequestMapping(value = "/helloworld", method = RequestMethod.GET) @RequestMapping(value = "/helloworld", method = RequestMethod.GET, params="param=param") . mapping .

    • Login Page를 는 문
      • FrontPage 는 Login Page create를 .
        • spring security "/create" url authentication
        • ui Signup는 부
        • RequestMapping method signup signup 들링
          • ... .. "signup " " ID PASSWORD를 리를 는" Request Name ..
      • 면 Spring Security Signup . 끗

11 29



    • 놀린 백링 . , backlink 무 부만..
    • linkback?
      • backlink는 는 링 (), linkback backlink는 방.

12 6


    • Java Matcher를 matches()는 find()는 substring . 를들 'abcde' 'bcd'를 matches를 면 못 find를 .

    • backlink
    • Java Matcher find() matches() 는데 .

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:05
Processing time 0.0410 sec