티스토리 뷰


구시스템 분석중에 jsp 경로를 찾기 쉽게하기위한 방법을 찾아보다가 없는듯하여 타일즈 관련 클래스를 직접 수정했다.


org.apache.struts2.views.tiles.TilesResult.java


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public void doExecute(String location, ActionInvocation invocation) throws Exception {
    setLocation(location);
 
    ServletContext servletContext = ServletActionContext.getServletContext();
    TilesContainer container = TilesAccess.getContainer(servletContext);
 
    HttpServletRequest request = ServletActionContext.getRequest();
    HttpServletResponse response = ServletActionContext.getResponse();
 
    if (log.isDebugEnabled()) {
        log.debug("-------------------------------------------------------------------");
        log.debug("request uri : "+request.getRequestURI());
        log.debug("-------------------------------------------------------------------");
    }
 
    container.render(location, request, response);
}


org.apache.tiles.impl.BasicTilesContainer.java



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
protected void render(TilesRequestContext request, String definitionName) {
 
    if (log.isDebugEnabled()) {
        log.debug("Render request recieved for definition '" + definitionName + "'");
    }
 
    Definition definition = getDefinition(definitionName, request);
 
    //===========타일즈 로깅 추가 시작 2017-08-31 by hhjeong==========
    if (log.isDebugEnabled()) {
        log.debug("definition:"+definition);
        Iterator<string> iter = definition.getAttributeNames();
 
        log.debug("-------------------------------------------------------------------");
        log.debug("body : "+definition.getAttribute("body"));
        log.debug("-------------------------------------------------------------------");
        while (iter.hasNext()) {
            String key = iter.next();
            log.debug(key + " : "+definition.getAttribute(key));
        }
        log.debug("-------------------------------------------------------------------");
    }
    //===========타일즈 로깅 추가 끝 2017-08-31 by hhjeong==========
 
    if (definition == null) {
        if (log.isWarnEnabled()) {
            String message = "Unable to find the definition '" + definitionName + "'";
            log.warn(message);
        }
        throw new NoSuchDefinitionException(definitionName);
    }
 
    render(request, definition);
}</string>



log4j.properties 에 아래 패키지 추가

1
2
log4j.logger.org.apache.struts2=DEBUG
log4j.logger.org.apache.tiles.impl=DEBUG


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함