본문 바로가기
풀스택/jQuery

jqery 활용 mysite2에 적용시키기 -보충

by woohyun22 2019. 2. 14.
복습겸 순서정리

- 네비게이션에서 연결 action ajax로

1
<li><a href="${pageContext.servletContext.contextPath }/guestbook?a=ajax">방명록(Ajax)</a></li>
cs


- actionfactory


1
2
3
 else if("ajax".equals(actionName)) {
            action = new AjaxAction();
        }
cs


- ajaxaction


1
2
3
4
5
6
7
8
public class AjaxAction implements Action {
 
    @Override
    public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        WebUtils.forward(request, response, "/WEB-INF/views/guestbook/index-ajax.jsp");
    }
 
}
cs


- index-ajax.jsp로


1
2
3
4
5
<link rel="stylesheet"
    href="${pageContext.request.contextPath }/assets/css/guestbook-ajax.css"
    rel="stylesheet" type="text/css">
<link rel="stylesheet"
    href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
cs


- guestbook-ajax.css를 읽어옴


-보충하기

728x90

'풀스택 > jQuery' 카테고리의 다른 글

jquery전 ajax 정의  (0) 2019.04.17
jQuery요약 2 ex20~36(append,prepend)  (0) 2019.02.12
jQuery 요약1 ex1~20(#, '.' , .text , if조건주는것)  (0) 2019.02.12

댓글