1.5.3이 나온지 일년이 지나서야 1.5.4 가 릴리즈 되었다.
그동안 사이트에 어떤 글도 올라오지 않아 스트라이프 망한줄 알았다.
사실 2010년 11월에 릴리즈 되었으니, 내 포스팅도 굉장히 늦은 감은 있긴 하지만 여튼 변경된게 무언지 알아보자
Change Log
체인지 로그에 보면 추가된 사항은 다음과 같다. [체인지 로그 확인]
- STS-678 : DynamicMappingFilter fails with "Could not get a reference to StripesFilter" on WAS 6.1
- STS-762 : Eliminate UrlBindingFactory.getInstance() from 1.5.x branch
- STS-767 : Showing an error message when the parameter name is _eventName
몇가지 변경된 사항은 없어보이나 막상 적용해보면 에러가 쏟아진다.
실제로 적용해서 무엇이 변경되었는지 알아보자.
동적 속성용 태그 라이브러리 추가
기존에는 태그 라이브러리 하나로 동적 속성을 지원하였다.
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<s:useActionBean beanclass="com.vine.admin_webapp.cm.action.ContentsEditActionBean" var="actionBean" event="read" />
<s:layout-render name="/layout/default.jsp" section="${actionBean.section}">
<s:layout-component name="pageTitle">컨텐츠 조회</s:layout-component>
<s:layout-component name="pageDesc"><p>컨텐츠 정보를 조회합니다.</p></s:layout-component>
<s:layout-render/>
1.5.3 까지는 태그에 동적 속성을 사용할 수 있었으나, 1.5.4에는 동적속성용 태그와 표준 태그를 분리하여 사용해야한다.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="d" uri="http://stripes.sourceforge.net/stripes-dynattr.tld" %>
<s:useActionBean beanclass="com.vine.admin_webapp.cm.action.ContentsEditActionBean" var="actionBean" event="read" />
<d:layout-render name="/layout/default.jsp" section="${actionBean.section}">
<s:layout-component name="pageTitle">컨텐츠 조회</s:layout-component>
<s:layout-component name="pageDesc"><p>컨텐츠 정보를 조회합니다.</p></s:layout-component>
<d:layout-render/>
더 자세한 것은 다음 링크 참조
http://www.stripesframework.org/display/stripes/Tag+Library+Doc
Layout-component 재사용 변경
레이아웃 페이지에서 중첩된 레이아웃을 사용할 경우 동일 페이지내에 동일 컴포넌트가 존재할 경우 중복 되어 처리된다. 즉,
/layout/default.jsp
<s:layout-component name="script">
<script type="text/javascript">
${script}
</script>
</s:layout-component>
</s:layout-render>
<s:layout-render name="/layout/blank.jsp">
<s:layout-component name="style">
<style type="text/css">
${style}
</style>
</s:layout-component>
</s:layout-render>
/layout/blank.jsp
<s:layout-definition>
<s:layout-component name="script"></s:layout-component>
<s:layout-component name="style"></s:layout-component>
</s:layout-definition>
와 같이 사용할 경우 스크립트 내용이 두번, 스타일부분이 2번 출력이 된다.
따라서 중첩된 컴포넌트를 사용할 경우 컴포넌트의 이름이 중복되지 않도록 다음과 같이 처리해야한다.
변경된 /layout/default.jsp
<s:layout-component name="script">
<script type="text/javascript">
${script}
</script>
</s:layout-component>
<s:layout-component name="style">
<style type="text/css">
${style}
</style>
</s:layout-component>
</s:layout-render>